Title: wp-minify.php Error &#8211; Workaround
Last modified: August 21, 2016

---

# wp-minify.php Error – Workaround

 *  [brent113](https://wordpress.org/support/users/brent113/)
 * (@brent113)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/wp-minifyphp-error-workaround/)
 * I am running WordPress 3.5.2 on Windows II8 with WP Minify 1.2.0
 * I am getting warnings in my PHP file like the following:
 * [25-Jun-2013 23:35:26 UTC] PHP Warning: filemtime(): stat failed for \\\\[server]\\[
   path1]\\[path2]\\Wordpress//wp-content/themes/visual/js/html5.js in \\[server]\[
   path1]\[path2]\Wordpress\wp-content\plugins\wp-minify\wp-minify.php on line 668
 * The line in question is: `$mtime = filemtime($path);`
 * I was able to fix it by adding:
 *     ```
       $base_path = str_replace('//', '/', $base_path);
       	  $base_path = str_replace('\\\\', '\\', $base_path);
       ```
   
 * just after:
 *     ```
       $base_path = trailingslashit($_SERVER['DOCUMENT_ROOT']);
       	  $base_path .= trailingslashit($this->get_base());
       ```
   
 * I think there’s two issues here. When the root filesystem is a network share 
   the document root variable returns a weird, invalid path because of the slashes.
   Second problem is when there is no base (function get_base returns nothing) the
   trailingshashit function adds another slash when it shouldn’t, breaking the path.
   So the first fix fixes the base path issue, the second fix fixes the server document
   variable.
 * Maybe something like this can get rolled into the next version (so I don’t have
   to re-inject the code :D)
 * Thanks for an awesome plugin!
 * [http://wordpress.org/extend/plugins/wp-minify/](http://wordpress.org/extend/plugins/wp-minify/)

The topic ‘wp-minify.php Error – Workaround’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-minify.svg)
 * [WP Minify](https://wordpress.org/plugins/wp-minify/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-minify/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-minify/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-minify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-minify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-minify/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [brent113](https://wordpress.org/support/users/brent113/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/wp-minifyphp-error-workaround/)
 * Status: not resolved