Permissions in a Local Dev Environment (OS X)

I wanted to enable WordPress auto-updates to work without FTP, so I added: define('FS_METHOD', 'direct'); to my wp-config.php.

So in order to grant write privileges to WordPress's auto-updater, I ran sudo chown -R _www:_www [wordpress-project-folder]. I'm using _www instead of www-data, because I read that it's OS X's equivalent.

However, now anytime I modify a file with a Text Editor or commit changes with git within that wordpress folder, I need to sudo, which is slowing me down.

Is there a happy medium?

Topic mac apache git permissions Wordpress

Category Web


It seems unorthodox but I added my user to the _www group:

$ sudo dseditgroup -o edit -a 'whoami' -t user _www

Finally, I gave write privileges to the group:

$ sudo chmod -R g+w /path/to/dir

That seems to work, but like I said seems like a weird solution to add my user to the _www group.

Maybe someone out there has a better solution.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.