Written by Steve Perry
Published on

Setting file permissions for a local WordPress test site

I’ve always struggled a bit with setting file permissions correctly for my local WordPress test sites. It’s never been a problem on my remote server but locally it’s been a pain.

The problem has been that I can have it one of two ways; I can manage plugins and core updates via the admin but not have correct file permissions to edit files consistently in my IDE or have the correct file permissions to edit the files but not be able to manage plugins and core updates via the admin (WordPress continuously asks for correct FTP credentials).

So I dug into this a bit today and found the following two articles which explain how to set up your local WordPress test site with the correct file permissions; a Linux flavour and an OSX specific mod.

So from these, there was essentially a two-liner that worked for me. The first adds my user to the group www and the second changes the ownership of the site files to www. The latter is what allows you to manage plugins and updates via the admin whereas without the former you lose editing capabilities in the Finder / IDE.

Adding my user to the www group

dscl . append /Groups/www GroupMembership usershortname

Change the ownership to www

sudo chown -R www:www .
Steve Perry Creative Ltd

Studio and registered office: 4 Back Lane, Brown Edge, Staffordshire ST6 8QS.

Copyright © 2012 – 2023 Steve Perry Creative Ltd., unless otherwise noted.

Registered in England & Wales, number 08354632.

Colophon

Typeset in Söhne Kräftig and Söhne Buch, by Klim Type Co.

Set as 32/64, 24/32, 20/32, and 12/16 on an 8px/96px grid.

Colour palette selected for AAA contrast.