Skip to content

Instantly share code, notes, and snippets.

@johansatge
Last active August 29, 2015 14:26
Show Gist options
  • Save johansatge/968f981128ab0ca49ce4 to your computer and use it in GitHub Desktop.
Save johansatge/968f981128ab0ca49ce4 to your computer and use it in GitHub Desktop.
Fixing Apache permissions on OSX Yosemite

Fixing Apache permissions

Original solution found on Francois Deschenes blog


You have just enabled the native Apache server on OSX Yosemite.

Now you observe permissions issues when trying to read or write your files.

This problem can be solved by setting _www, the Apache user, as the owner of your document root:

sudo chmod -R +a '_www allow read,write,delete,add_file,add_subdirectory,file_inherit,directory_inherit' [your_doc_root]

Then you can allow the _www group to edit the doc root:

chmod -R g+w [your_doc_root]

And finally, add your own user to the _www group:

sudo dseditgroup -o edit -a `whoami` -t user _www
# This will be useful if you want to edit or remove files that have been created by PHP (cache files, uploaded data...) from the Finder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment