miguel.nz

Fixing apache file permissions on Mac (El Capitan)

December 20, 2016   |   1 minute read.

I’ve been using my local development environment with apache, php, mysql and always had some issues with file permissions, but never gave it enough attention to fix it as I was always doing something else. Tired of this, wanting to do some backups with WordPress, plugins, etc I’ve found the following commands that fixed my machine, hope this can help you.

Here we go:

Open httpd.conf:

sudo vim /etc/apache2/httpd.conf

Go and find the following line:

User _www
Group _www

Now change it to:

User your-username
Group staff

Restart apache:

sudo apachectl restart

You can also update your folder ownership with the

chown -R your-username:staff foldername

Remember to replace your-username with your real username in my case is miguel. My parents did a great job with my name, aye!

Have a nice day.

Further reading

http://serverfault.com/questions/106713/changing-ownership-of-a-folder-using-terminal
http://stackoverflow.com/questions/8035939/write-privileges-localhost-mac-osx
http://stackoverflow.com/questions/2001881/correct-owner-group-permissions-for-apache-2-site-files-folders-under-mac-os-x