0

Server is Cento7 running Nginx & PHP. I run Nginx and PHP-FPM as user nginx. nginx is a member of a group called webmasters.

My website is at /var/www/production/site/

Owner of /var/www/production/site/ is other_user:webmasters. Permissions are 0775 These are both applied to all subdirectories.

A PHP script calls file_put_contents() but gets 'permission denied' as it attempts to write to a subdirectory.

If I change the owner of /var/www/production/site/ to nginx:webmasters I do not get permission denied.

SELinux is disabled.

So as a member of a group with RWX it cannot write. Any suggestions?

0

The php-fpm is a separate daemon and it (probably) runs as different user (not nginx).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.