I have a user on my Linux machine ("php") that is a member of two groups. The main group is php, and the secondary group is www.
I have a directory on my Linux machine (/ home / www / public / wp-content / uploads) whose user wwwand whose group wwwand whose permissions are set to 775.
I expect a process running as a php user should be able to read and write files in this directory. If I run a script from the command line that the fopenfile in this directory as a php user, it works fine!
However, if I run php-fpm with the user "php" and the group "php", when I try to write to this directory, I get an "access denied" error.
I expect the php-fpm process will still be able to write to this directory, since it works as a php user who is part of the www group that owns the directory. But I get a "permission denied".
Why is the behavior of php-fpm different from the behavior of php script?
(I restarted php-fpm after adding the second group, so this is not a problem with the immobility issue.)
source
share