Running PHP 5.4 and Apache2 on Debian 7, with apache configured to use user www-data
.
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 :
Case 1
-
Set User to
root
and Group towww-data
: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/
-
Current
ls -l
output 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:
Case 2
-
Permissions are identical to 1, but user is set to
www-data
:chown -R www-data:www-data /var/www/site-dir/wordpress-dir/
-
Outcome: WordPress is now able to delete the plugin:
Question
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?
2 Answers
duplicate? At least you can find lots of (possible) explainations and (possible) solutions here:
https://stackoverflow.com/questions/640409/can-i-install-update-wordpress-plugins-without-providing-ftp-access