Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Here's the problem file: /home/iain/sites/wp1/.htaccess -- attempting to change permalink settings gives me messages indicating that .htaccess is not writable, and the content that I should put into it myself. The file permission is 664 and the directory permission on /home/iain/sites/wp1 is 775, 755 from / up to there. www-data is a member of group iain so has write access to that file. –  ikmac Mar 12 '13 at 23:36
    
otay, the third time I rm -r everything and drop all tables from the db, and suddenly WP updates the permalinks without complaining, creating the .htaccess file and everything. However, the URL rewrite isn't working -- 404 from Apache, and "rewrite" is enabled. –  ikmac Mar 12 '13 at 23:56

2 Answers 2

WordPress permissions can be confusing. In general, WordPress wants to be www-data as the owner of the files & directories. So I would recommend doing a:

chown www-data -R [path to your wp-content directory]

And then see what happens.

share|improve this answer
    
The .htaccess file that WP is complaining about is in the / directory, not /inst/wp-content. WP also successfully created the wp-config.sys file, no whining. Very confusing. –  ikmac Mar 12 '13 at 20:45
    
So what are your folders & permissions? Can you list them in your question? –  JakeGould Mar 12 '13 at 23:01
    
The permissions and problem file are already in the question, but I've added a comment adding the info that permalink settings aren't working -- that's where WP says it can't write the .htaccess file. –  ikmac Mar 12 '13 at 23:38

An easy fix that works for me in this situation is to delete the .htaccess file and then reupload a blank .htaccess using an ftp client. Then chmod/chown if needed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.