Recommended File Permissions

Hey guys, I have been spending the longest time trying to figure out this issue. I would like to know what the file permissions should look like in WordPress in order to use the autoupdate feature. As of now, my wordpress installation keeps asking me for my FTP information and I do not want to use that method of upgrading/installing, I want to use pure/direct PHP.

Some context:

  • webserver and php fcgi daemons run as www-data:www-data
  • wordpress installation is at /home/blaenk/sites/domain.tld/

At first, I read that all files/folders should be owned by my user (blaenk) and writable by my user. But this wasn’t working, after spending many hours researching, someone on the IRC channel told me to try setting everything to ownership www-data:www-data and this worked. I was no longer asked for FTP information and the plugin installation worked automatically.

However, I originally placed the site files in my home directory precisely because I wanted to be able to write/create them as my user. I even added myself to the www-data directory as stated in this guide.

Question

I already know that files should be 644 and directories should be 755. However, this seems more of an issue of ownership. I don’t want to have to set www-data:www-data on everything in my wordpress installation, so I’m wondering what files/directories specifically require this ownership level?

EDIT: I believe that the reason for which everything seems to work on my shared hosting wordpress installation despite all of the files being owned by my user is that the shared host I use seems to use suexec which presumably runs PHP as me, so in other words, the files are owned by the webserver, so to speak.

4 s
4

As far as I understand it is not related to specific permissions – Auto Update overall requires that files owner matches user Apache runs under. If that is not the case it falls back to other filesystem methods (FTP, SSH) and so prompts for password.

You can define credentials in constants in wp-config.php so you don’t get prompted for them.

See WordPress Upgrade Constants in Codex.

Leave a Comment