Title: [Plugin: Better WordPress Minify] Can&#039;t change cache dir
Last modified: August 20, 2016

---

# [Plugin: Better WordPress Minify] Can't change cache dir

 *  Resolved [Katherine Semel-Munson](https://wordpress.org/support/users/ksemel/)
 * (@ksemel)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-better-wordpress-minify-cant-change-cache-dir/)
 * I’m unable to change the location of the cache dir using the config.php.
 * I’ve added my existing cache dir to the file in place of the default $min_cachePath
   `
   $min_cachePath = '[my blog root]/wp-content/cache/min/';`
 * but the options page still shows the default url in the field
    `[my blog root]/
   wp-content/plugins/bwp-minify/cache/`
 * Am I missing a step? Does the config.php file need to be enabled somehow?
 * [http://wordpress.org/extend/plugins/bwp-minify/](http://wordpress.org/extend/plugins/bwp-minify/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-better-wordpress-minify-cant-change-cache-dir/#post-2541932)
 * You can ignore what’s shown in the option page, as it is automatically guessed
   based on your minify URL. It will not affect the plugin’s functionality, don’t
   worry :).
 *  [admintiger](https://wordpress.org/support/users/admintiger/)
 * (@admintiger)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-better-wordpress-minify-cant-change-cache-dir/#post-2542161)
 * This issue is marked resolved, but there actually are serious problems associated
   with what ksemel reported when bwp-minify is used with various common server 
   configurations. I have only spent a short time testing, reading the code, and
   identifying problems, but this is what I have found so far.
 * bwp-minify’s path-guessing fails under Windows, works with dedicated host serving
   under Linux, but fails with common virtual host serving configurations under 
   Linux. Those problems are due in part to $_SERVER[‘SUBDOMAIN_DOCUMENT_ROOT’] 
   containing a static path set in an Apache config file, rather than a valid path
   to an individual virtual host document root. There also is a malfunction associated
   with the use of @parse_url($minurl) that I haven’t fully-determined yet.
 * Additionally the default empty string setting of $min_documentRoot in the min
   config.php is not valid with virtual host web serving, because it causes $_SERVER[‘
   DOCUMENT_ROOT’] to be used, which isn’t reliable for the reason explained above.
   The solution is to set $min_documentRoot as shown below, which I have found works
   reliably with both dedicated and virtual hosting under both Windows and Linux:
 *     ```
       $min_documentRoot = substr($_SERVER['SCRIPT_FILENAME'], 0, -strlen($_SERVER['SCRIPT_NAME']));
       ```
   
 *  [admintiger](https://wordpress.org/support/users/admintiger/)
 * (@admintiger)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-better-wordpress-minify-cant-change-cache-dir/#post-2542162)
 * After making the post above I discovered that min also uses $_SERVER[‘DOCUMENT_ROOT’]
   in several other places. Because of that, it appears to me that min will fail
   to work correctly with a significant percentage of web servers unless its code
   is patched in several places.
 *  [Coksnuss](https://wordpress.org/support/users/coksnuss/)
 * (@coksnuss)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-better-wordpress-minify-cant-change-cache-dir/#post-2542164)
 * I am running a webserver at port 8443 with SSL…
    The Plugin does not work with
   this settings. When calling my WP installation ([https://example.tld/](https://example.tld/))
   the plugin is trying to call [https://example.tld/wp-content/plugins/bwp-minify/min/?f=:8443/wp-content/*](https://example.tld/wp-content/plugins/bwp-minify/min/?f=:8443/wp-content/*)
   Also its trying to set the cachedir to <htdocs>/:8443/wp-content/plugins/bwp-
   minify/cache and fails to detect its own location in <htdocs>/wp-content/plugins/
   bwp-minify/cache
 * In other words – This plugin (as of now) is not working with our installation
   and the page gets messed up because no CSS and JS files are loaded.
 *  [Coksnuss](https://wordpress.org/support/users/coksnuss/)
 * (@coksnuss)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-better-wordpress-minify-cant-change-cache-dir/#post-2542165)
 * Sorry – The WP Installation is running at [https://example.tld:8443](https://example.tld:8443)
   and the plugin is trying to call [https://example.tld:8443/wp-content/plugins/bwp-minify/min/?f=:8443/wp-content/*](https://example.tld:8443/wp-content/plugins/bwp-minify/min/?f=:8443/wp-content/*)
 *  Plugin Author [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * (@oddoneout)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-better-wordpress-minify-cant-change-cache-dir/#post-2542166)
 * [@admintiger](https://wordpress.org/support/users/admintiger/): The codes you
   found inside bwp-minify only try to guess the cache dir to *show* it to the user,
   with no intention of using it for min application to be exact, so it’s not important
   that it is guessed correctly :). Regarding DOCUMENT_ROOT, it is something that
   should be configured differently on each user’s web server, that’s why I provide
   an easy way to move the min folder to another place of choice, and then you can
   play with the config file without worrying about the plugin’s update. I will 
   write a short tutorial soon on how to make the most our of the min URL feature
   of BWP Minify.
 * [@coksnuss](https://wordpress.org/support/users/coksnuss/): that bug has been
   fixed in 1.2.0, which will be released this week.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘[Plugin: Better WordPress Minify] Can't change cache dir’ is closed to
new replies.

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

 * 6 replies
 * 4 participants
 * Last reply from: [Khang Minh](https://wordpress.org/support/users/oddoneout/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-better-wordpress-minify-cant-change-cache-dir/#post-2542166)
 * Status: resolved