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

I am hosting a webserver. I set it all up for wordpress to save time, and got connected, and then tried to upload a theme, and it failed. It didn't have enough permission to write to the server. As i said, i am hosting it myself, so how do i go about giving Word Press enough permission to write files via FTP? I entered all my FTP details in correct, and i know my FTP account has all the permissions needed, as i am having to go in and create these folders and send files :C.

How do i fix this without giving it 777 permissions?

share|improve this question

migrated from webmasters.stackexchange.com Feb 1 '13 at 10:47

This question came from our site for pro webmasters.

1 Answer 1

Log in on the command line using the same user that Wordpress will be using.

Switch to the directory where the wordpress files are going.

cd insert-directory-here

Run this command:

chown -R `whoami` . && chmod -R u+rw . && find . -type d -exec chmod u+x {} \;

That should recursively change the ownership of the entire directory to yourself. Then it makes sure you have read write permissions everywhere in it. Then it makes sure you have execute permissions on all the directories (which is what you need to read them and create files there).

If that command fails for any reason, then you have a better idea of which files exactly are causing you problems.

share|improve this answer
    
Sweet, worked like a charm. Greatly Apreciated! would vote up, but not enough rep :C –  ReallyGoodPie Jan 30 '13 at 17:21
    
wait i just tried to do something telling me i didn't have enough write permissions. sorry :C –  ReallyGoodPie Jan 30 '13 at 17:24
    
"find . -type d -exec chmod u+x {} \;" : chmod -R u+X is more elegant –  coincoin Feb 1 '13 at 11:33

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.