Forum Replies Created

Viewing 1 replies (of 1 total)
  • I was able to fix it. There are 2 problems here and my solution is to use transients instead of a .php file to generate the “loader-map” cached classes map. WP Engine makes new “.php” files added through a php script with 600 (permissions) instead of 644… There is no way to make them 644 unless you reset your file permissions every time the file gets generated OR use any other file extension like .tmp.

    Second problem is this line: $cached = ( require $cache_file ); (Inside loader.php). This is causing the 502… Again, if this information gets stored in a transient, you won’t have this problem…

    To fix this, I replaced “.php” with “.tmp” for the loader-map file like this:
    (Inside loader.php)
    1. $cache_file = str_replace( '.php', '.tmp', $cache_file ); (add this after $cache_file = $this->_get_cache_file_path( $path );)
    2. Replace $cached = ( require $cache_file ); with $cached = eval( str_replace( '<?php ', '', file_get_contents( $cache_file ) ) );

    • This reply was modified 6 years, 1 month ago by explorador20.
Viewing 1 replies (of 1 total)