i'm stuck & need help understanding file create permission for members of group.
in php, i want to fopen / create a file in a folder that is owned by mysql:mysql (for importing data into mysql)
drwxrwx--- 2 mysql mysql 4096 Dec 14 14:33 /var/lib/mysql-files
php runs as user www-data
i added 'www-data' user into group 'mysql'
sudo usermod -a -G groupName userName
sudo groups www-data www-data : www-data mysql
it appears my php user account 'www-data' has write permissions to the folder through group membership, but I get an error 13 'permission denied'.
while typing this question, a similar question (https://serverfault.com/a/534000/65092)
had an answer that the parent folders (/var and /var/lib) need to have 'x' permissions for the user or group, I understand that to mean:
php user 'www-data' needs to be able to look inside /var , to read /lib , to read /mysql-files .
/var = drwxr-xr-x 16 root root /var/lib = drwxr-xr-x 62 root root
and it appears this is already enabled.
any suggestions or comments? thanks.