• Resolved therealgilles

    (@chamois_blanc)


    Once in a while, I get the following PHP warning on my site:

    WARNING: wp-content/plugins/merge-minify-refresh/merge-minify-refresh.php:525 - file_get_contents(.../public_html//wp-content/uploads/elementor/css/global.css): failed to open stream: No such file or directory

    The file does not exist, but MMR seems to want to load it. I have the file in the excluded list because it does exist sometimes and needs to be excluded.

    Would it be possible to add a check for file existence to avoid this issue?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter therealgilles

    (@chamois_blanc)

    Here is a possible fix in merge-minify-refresh.php:

    
          for($i=0,$l=count($handles);$i<$l;$i++) {
    
                  ...
    
                  $file_content = @file_get_contents($this->root.$script_path);
                  if (!$file_content) continue;
    
                  $contents = '';
    
                  if($ext == 'js' && isset($scripts->registered[$handle]->extra['before']) && count($scripts->registered[$handle]->extra['before']) > 0) {
                    $contents .= implode($script_line_end,$scripts->registered[$handle]->extra['before']) . $script_line_end;
                  }
    
                  // Remove the BOM
                  $contents .= preg_replace("/^\xEF\xBB\xBF/", '', $file_content) . $script_line_end;
    
                  ...
          }
    
    • This reply was modified 5 years, 6 months ago by therealgilles.
    Plugin Author launchinteractive

    (@launchinteractive)

    I haven’t seen this error before but I’ve added a check in the latest version that should be released in a few days. It should solve this. I will mark it as resolved. Please open a new ticket if it doesn’t.

    Thread Starter therealgilles

    (@chamois_blanc)

    This problem has re-appeared. Was the fix removed by accident?

    Thread Starter therealgilles

    (@chamois_blanc)

    Maybe it’s new code. Here is the warning:

    WARNING: wp-content/plugins/merge-minify-refresh/merge-minify-refresh.php:817 - file_get_contents(.../wp-content/uploads/elementor/css/global.css): failed to open stream: No such file or directory

    Plugin Author launchinteractive

    (@launchinteractive)

    It looks like this is the same error in a different part of the code. I’ve released a new version that should fix it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP warning: failed to open stream: No such file or directory’ is closed to new replies.