How do I get the right permissions for WordPress running Apache on Debian

Many of the examples assume you’re not the only person running stuff on the server, or that suPHP or some other utility is running to make PHP run as a user other than the web server.

With a basic Debian LAMP install, where PHP runs as the www-data user, it’s safe and normal to set ownership of everything under the web server document root directory as owned by www-data:www-data with permissions 700/600 or 770/660.

The only issue then is when you (as a user) want to put files into those directories, in which case you either need to add yourself to the www-data group (and use the second set of permissions above) or do it via sudo or as root, and remember to set the permissions later.

Personally, now that WordPress can auto-update and auto-install plugins and themes, I just set everything to www-data:www-data and let WordPress handle it, works fine.

The walkthroughs that talk about setting permissions to your username assume PHP is running as you, through as I say, some other extension or Apache mod.

Leave a Comment