Title: fastcgi_cache_purge with open_basedir issue
Last modified: December 7, 2020

---

# fastcgi_cache_purge with open_basedir issue

 *  [gahia](https://wordpress.org/support/users/gahia/)
 * (@gahia)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/fastcgi_cache_purge-with-open_basedir-issue/)
 * Hi!
 * I setup the plugin to work with the `fastcgi_cache_purge` module and it is not
   purging the cache. I’ve found that this is because the `open_basedir` setting
   enabled:
 * `is_dir(): open_basedir restriction in effect. File(/var/run/nginx-cache) is 
   not within the allowed path(s): (...) /wp-content/plugins/nginx-helper/admin/
   class-purger.php on line 1228`
 * But why is trying to perform filesystem actions when it should just make a GET
   request?
 * I know I can add the `nginx-cache` folder to the `open_basedir` paths, but it
   will be nice to avoid need doing it when you’re using the module method.
 * Thanks so much for this plugin!
 * PS: I’ve tried the URL mysite/purge/ and works good.

Viewing 1 replies (of 1 total)

 *  Thread Starter [gahia](https://wordpress.org/support/users/gahia/)
 * (@gahia)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/fastcgi_cache_purge-with-open_basedir-issue/#post-13753533)
 * After checking the code, I’ve realized that this was affecting only to the **
   Purge All** method as it’s ignoring the setting to use the module and trying 
   to remove the entire cache directly by the filesystem. This means it will never
   works unless you add the folder to its allowed paths and grant permissions to
   that folder.
 * This is may be ok for a single WordPress installation but I you looks for a safe
   environment it will be better to keep the `open_basedir` policy enabled and don’t
   grant any permissions to users for system folders.
 * Then I’ve opted to install the [a newer “version” or the module](https://github.com/nginx-modules/ngx_cache_purge)
   that allow the use of wildcards. I understand that this feature was missing form
   the original module you recommend and it doesn’t make possible to clear all cache
   unless you do it through the filesystem.
 * It will be nice if you can make this small changes in the plugin:
 * 1) Purge all though the `ngx_cache_purge` module
    2) Custom purge accepting wildcards
 * Thanks!

Viewing 1 replies (of 1 total)

The topic ‘fastcgi_cache_purge with open_basedir issue’ is closed to new replies.

 * ![](https://ps.w.org/nginx-helper/assets/icon.svg?rev=2360932)
 * [Nginx Helper](https://wordpress.org/plugins/nginx-helper/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nginx-helper/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nginx-helper/)
 * [Active Topics](https://wordpress.org/support/plugin/nginx-helper/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nginx-helper/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nginx-helper/reviews/)

## Tags

 * [open_basedir](https://wordpress.org/support/topic-tag/open_basedir/)

 * 1 reply
 * 1 participant
 * Last reply from: [gahia](https://wordpress.org/support/users/gahia/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/fastcgi_cache_purge-with-open_basedir-issue/#post-13753533)
 * Status: not resolved