Saturday, May 16, 2015

wordpress - How do I make files writable on my LAMP?

I have Ubuntu 12.10, and installed MySQL, Apache, and PHP. I used groupmod -a -G iain www-data to add the www-data user to my primary group.



WordPress claims that its files are not writeable. What gives? Apache runs as www-data, www-data is a member of group iain, and the files/directories in the site are all 664/775 so WordPress should be able to write there. I have logged in as www-data (sudo -s ; su - www-data) and edited the .htaccess that WordPress claims it cannot edit. I have confirmed that Apache runs as www-data (using ps aux | grep apache)



This used to work on Ubuntu 12.04 and suddenly does not work on 12.10. Anyone know the new magic words to make writeable files writeable for WordPress?



EDIT: I discovered that /var/www is owned by root:root. Changing ownership to www-data didn't help though.




EDIT: Sorry -- forgot to mention, it's the .htaccess file that WP refuses to touch. And also if I go and make the changes it tells me to, I get 404 errors direct from Apache, not WP.



MEH. Suddenly on the third time I rm -r /home/iain/sites/wp1 and drop all tables from the db, and untar the WP distro doing exactly the same things it creates the .htaccess file without complaining when I change permalink settings.



Unfortunately, what it writes to the .htaccess file is wrong because Apache gives me 404 errors following links on the sample site. All of this worked right out of the box a couple months ago, and now it's giving me a monstrous crapulus.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...