Permissions when associated with WordPress is something that I would never understand.
Here are the problems:
First problem is uploading. If I start from a fresh Ubuntu 12.04 installation then moving onto the installation of LAMP stack which I usually do by
sudo apt-get install lamp-server^
then the installation of WordPress. Uploading anything within WordPress will not work. Not themes nor plugins nor data. However, I fixed that by adding files & directories to www-data/apache user & group. Themes, plugins, data can now be uploaded within WordPress. I also added currentuser and root to the usergroup, www-data.
File: www-data:www-data 644
Directory: www-data:www-data 755
Where do I get the idea to do this? It's from a StackOverflow answer which I found a few months ago.
Second, is script execution. In this case, PHP. Despite having the correct perms, 644 (666 sometimes) for files and 755 for directories. However, some WordPress plugins still can't write to them to unless having 777 perms. What's funny is when I look at the support forums of the stubborn plugin, I see no one else reporting this issue.
Help? This is something I have been struggling to solve for months. I can either go
- a) Find the perms-hungry file and give it 777
- b) Stop using the plugin
It's usually b) btw.
The plugins that I'm having problems with are: 1) Ep HashImage 2) Easy-Instagram
Basically what they do is download images from an external source and downloads it to wp-content/ not sure specifically where though.
I have tried searching for solutions such as using suexec & suPHP. However, that always ends with my server not working entirely. Is there any other solutions?
Do help me on this, thanks!
sudo find /var/www -type f -exec chmod 644 {} \; sudo find /var/www -type d -exec chmod 755 {} \; sudo chown www-data:www-data /var/www -R