For those who have their wordpress root folder under their home folder:
Ubuntu/apache
- Add your user to www-data group:
CREDIT Granting write permissions to www-data group
You want to call usermod
on your user. So that would be:
sudo usermod -aG www-data yourUserName
Assuming www-data
group exists
- Check your user is in
www-data
group:
groups yourUserName
You should get something like:
yourUserName : yourUserGroupName www-data
yourUserGroupName is usually similar to you user name
- Recursively change group ownership of the folder keeping your user ownership
chown yourUserName:www-data -R yourWebSiteFolder/*
- Change directory to yourWebSiteFolder
cd yourWebSiteFolder
- Recursively change group premissions of the folders and sub-folders to enable write permissions:
find . -type d -exec chmod -R 775 {} \;
mode of /home/yourUserName/yourWebSiteFolder/'
changed from 0755 (rwxr-xr-x)
to 0775 (rwxrwxr-x)
- Recursively change group premissions of the files and sub-files to enable write permissions:
find . -type f -exec chmod -R 664 {} \;
The result should look something like:
WAS:
-rw-r--r-- 1 yourUserName www-data 7192 Oct 4 00:03 filename.html
CHANGED TO:
-rw-rw-r-- 1 yourUserName www-data 7192 Oct 4 00:03 filename.html
Equivalent to:
chmod -R ug+rw foldername
Permissions will be like 664 or 775.