Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'No such file or directory' or ''Permission denied' errors, though cache owned by user #332

Open
jamminjames opened this issue Apr 1, 2024 · 1 comment

Comments

@jamminjames
Copy link

jamminjames commented Apr 1, 2024

I can't get nginx-helper to work in Wordpress. I'm using nginx Fastcgi cache for the caching method, and have the settings as suggested in the Wordpress plugin:
RT_WP_NGINX_HELPER_CACHE_PATH is set to the correct path, the cache is stored on the same server as WordPress, and we are using the default nginx cache options (levels=1:2) and (fastcgi_cache_key "$scheme$request_method$host$request_uri").

In nginx.conf and www.conf, the user and group are the same as the owner of the Wordpress install directories. I can purge files while logged into the server as that same user. However, I am seeing, for example, unlink() "/var/lib/nginx/cache/e/6e/4cf204232527c7520cf873d969aa56ee" failed (2: No such file or directory) (or 'Permission denied') errors in the nginx error log when I try to purge from Wordpress, depending on if I change the owner/group of the cache directories, which I did to see if anything worked. I've tried changing the cache directory ownership recursively to various settings, including username:username, username:nginx, and nginx:username. The latter is where I got the 'Permission denied' error, otherwise it was 'No such file or directory'.

Also, I have used setfacl to set permissions to rwx for both owner and group.

I have the plugin set to log 'info' level, and it shows a successful "Purged Everything!" message, but the files are still there.

What am I doing wrong? Thanks for any help.

@josbroers
Copy link

Hello @jamminjames,

I'd like to verify if you've defined the RT_WP_NGINX_HELPER_CACHE_PATH constant to correspond with the directory specified in your nginx configuration. Did you set it up like this?

define( 'RT_WP_NGINX_HELPER_CACHE_PATH', '/var/lib/nginx/cache/' ); 

Additionally, could you please provide information on the user that nginx runs on, the user that PHP runs on, and the permissions of the directory /var/lib/nginx/cache/?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants