WordPress + Xampp on Mac Update Permissions Problem

If you are running WordPress on OS X using XAMPP for local development then you likely have tried to upload core or a plugin and encountered the following error while prompted for FTP Connect Information:

To perform the requested action, WordPress needs to access your web server.

This is because by default XAMPP runs as the user `nobody` on Mac and this causes some permissions issues. Additionally WordPress prior to upgrading writes a file to the system and then checks to see which user wrote the file. If this file does not match the user running PHP it will refuse to upgrade, even if write permissions existed. chmod 777 is not sufficient to get past this; you must have the correct user as well. I don’t know why they did this and if there’s a technical reason for it, but it’s annoying.

The solution: Edit your httpd.conf to run as your username for the user and staff for the group.

Open httpd.conf in TextEdit:

sudo open -e /Applications/XAMPP/xamppfiles/etc/httpd.conf

Change:

User nobody
Group nogroup

To:

User your_mac_username
Group staff

Restart Xampp and this should correct the problem; you can verify it worked by running in a .php file.

If you still encounter issues you can check a couple of other things. First verify ownership (most likely problem):

sudo chown -R your_mac_username:staff /path_to_webroot/www/

Next confirm permissions (you can change 777 if you need higher security):

sudo chmod -R 777 /path_to_webroot/www/

Leave a Reply

Your email address will not be published. Required fields are marked *