The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

WP Minify
Bad Request on minified file (4 posts)

  1. qvasi
    Posted 3 years ago #

    The only relevant error message in the log file were several lines like this (one for each css or js file):

    [Wed Oct 03 13:36:26.035241 2012] [:error] [pid XXXX] [client] PHP Warning: filemtime(): stat failed for /opt/lampp/htdocs/wordpress/wordpress/wp-content/plugins/sitepress-multilingual-cms/res/js/sitepress.js in /opt/lampp/htdocs/wordpress/wp-content/plugins/wp-minify/wp-minify.php on line 668, referer: http://localhost/wordpress/MYSITENAME/

    Making sure each file had the same owner as the lampp process (running on localhost, since I didn't want to test an untested plugin on our server) did not help.


  2. Kimberly
    Posted 3 years ago #

    i once got a similar error and noticed this plugin was merging the base path with the file path in a way that resulted in two forward-slashes in the file path being sent to filemtime() creating the "stat failed" response. I now check and strip out the extraneous slash before the call.

    In your case i notice you have "wordpress" repeated twice in the path which probably indicates you have a base path pointing inside "wordpress" but your file path is also using "/wordpress", hence: "/wordpress/wordpress"

  3. Beach Carolina Magazine
    Posted 3 years ago #

    Lately I get the error:

    PHP Warning: filemtime() [<a href='function.filemtime'>function.filemtime</a>]: stat failed for .../public_html/beachcarolina.com///platform.twitter.com/widgets.js in .../public_html/beachcarolina.com/wp-content/plugins/wp-minify/wp-minify.php on line 668

    which seems to point to the line 668-> $mtime = filemtime($path);

  4. Kimberly
    Posted 3 years ago #

    Replace line 667 which currently shows:

    $path = $base_path.$location;

    with this:

    $path = preg_replace("!/{2,}!","/",$base_path.$location);

    That will fix your problem.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Minify
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic