Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

When I use wordpress to install a new theme it creates the permissions and ownership in such a way that I can't edit the files via FTP.

Any ideas?

(Using Plesk)

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

Given that you are the webhost:

If the server is a dedicated server, or you're in any situation where you're the only user of the server in question, then this is a GOOD thing! It means your setup is more secure this way.

It basically means that somebody who hacks into your site through the webserver "door" will have a limited set of permissions, and will be unable to edit files. Which is exactly what you want to happen.

If this is a "shared" server, where you're hosting more than one site and have more than one "user", then you need to change the webserver to run using a method known as "SetUID". There's many ways to do this, suPHP, FastCGI in a setuid wrapper, etc. This makes the PHP process which is running the site run as the user who owns the PHP files, providing increased intra-user security.

Now, you may think, "why would running as the owner of the files be more secure?" Answer: Different circumstances. When more than one user has a web directory on the site, all being served by the same webserver, then the webserver user has access to all those users files (read-only, sometimes more). But each user should be locked down to see their own files. So in the event of a compromise, you want the hacker to have the rights only of one of those users, not of the webserver user.

So, basically, if you really want, you can change the ownership of the theme files to be those of the webserver user (or rather, whatever user the PHP process is running as), and thus get access to them in the WP editor. But, unless you're setup for a shared server environment and using setuid wrappers to be more secure in that fashion, then you really don't want that.

share|improve this answer
add comment

When you install the theme via WordPress, the web server is the one creating the files for the theme and as a result, they will be owned by the user that webserver is running under (which is most likely why you can't edit them).

You can change the ownership on the files with the command:

chown -R [your ftp username]:[your ftp usergroup] ./theme-directory

You also may need to change the permissions on the theme files, permissions are highly web server setup dependant.

More information about permissions:

http://codex.wordpress.org/Changing_File_Permissions

The only directory within WordPress that generally needs to be writeable by the web server is the /wp-content/uploads directory. None of the files need to be ownable by the webserver user (in a shared environment they shouldn't be, on a dedicated host it's less of an issue).

share|improve this answer
add comment

Contact your webhost. It sounds like the user that the webserver is running as isn't the same as your FTP user. This can cause other problems within WordPress as well. If you FTP the themes into place, I doubt you'll be able to update the WP core, themes and plugins with the built-in updater, without entering your FTP credentials.

share|improve this answer
    
maybe i should migrate the question? I am the web host :P –  mkprogramming May 21 '12 at 20:14
    
"I doubt you'll be [able] to"... to what? Can you clarify your answer? –  Ian Dunn May 22 '12 at 6:16
    
Not sure why my reply was truncated. Anyway, updated. Most (all?) major webhosts that support WordPress will run the site as the same user as FTP. Changing the file permissions doesn't resolve the issue, just the symptoms. You'll have to update the permissions each and every time you make a change... and you still wont be able to use the updater without entering your FTP credentials. The web server needs to be able to write to the entire WP install, otherwise WP can't update itself. –  user1337 May 22 '12 at 15:38
add comment

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.