Running PHP 5.4 and Apache2 on Debian 7, with apache configured to use user
I'm trying to figure out why Wordpress cannot modify files in its directory when it has group ownership with full permissions, and seems to only work if it has user ownership.
Allow me to illustrate :
Set User to
rootand Group to
chown -R root:www-data /var/www/site-dir/wordpress-dir/
Set Permissions to read, write and execute for both user and group.
chmod -R u=rwx,g=rwx /var/www/site-dir/wordpress-dir/
ls -loutput of the Wordpress directory:
drwxrwsr-x 5 root www-data 4096 Jul 11 15:20
Outcome: When trying to delete a plugin, Wordpress claims it does not have access:
Permissions are identical to 1, but user is set to
chown -R www-data:www-data /var/www/site-dir/wordpress-dir/
Outcome: Wordpress is now able to delete the plugin:
I'm trying to understand what's going on here. Why does the user have to be
www-data, even when using
www-data as group it has full permissions?
With my (limited) understanding of linux permissions I would assume that, since the apache process running Wordpress is using the
www-data user, it would have complete access to do whatever it needs to in case 1, because the group is recursively set as
www-data, and group permissions are recursively set to read, write and execute.
Why does the user need to be
www-data for this to work?