Software Developer

File Permissions for Local WordPress Development on LAMP

This permission scheme will avoid the “Unable to save – Permission denied – File is Read only” error when you try to save a file in your local /var/www/html/ directory. This will let you edit “Read only” files by adding you to the www-data group and granting the group permission to write to the files.

First, add your user to the www-data Apache group (replace ‘username’ with your own):

sudo usermod -aG www-data username

Note: The -aG option above will add you to that group and also keep your memberships to other groups.

After doing the line above, you should log out of your system and back in for the “usermod” to take effect.

Run this to grant ownership to the www-data Apache group, which you are now a part of:

sudo chown -R www-data:www-data /var/www/html

Assign these files to the www-data group, if it’s not already done:

sudo chgrp -R www-data /var/www/html

Grant permission for owner and group to read, write, and execute (do this at your own risk):

sudo chmod -R 775 /var/www/html

By

Questions and Comments are Welcome

Your email address will not be published. All comments will be moderated.

Please wrap code in "code" bracket tags like this:

[code]

YOUR CODE HERE 

[/code]