MAMP Pro is great, but its been a learning curve to get to grips with the various settings for running a development server with Wordpress on it. You may get a range of issues when updating Wordpress, Wordpress Plugins, Uploading Files etc. Other than being asked for FTP details common issues are:-

Could not create directory.
An error occurred while updating
Plugin: Could not create directory.
Could not create directory unable to create directory wp-content/uploads/x. Is its parent directory writable by the server?

... and various other permissions issues.

There are various discussions online about such issues and many of these seem to centre around CHMOD 777 / permissions changes to wp-content, plugins, update folder(s). Whilst this can work by plugging through folders, please don't do this as a universal CHMOD to 777 of folders could pose a security risk - yes you are working locally, but when you go live you're going to have to reset Wordpress permissions.

Here are 3 approaches to fix this issue

1. You are working locally on localhost and won't be using Dynamic DNS to connect your site to the Internet

1. Following on from our previous post open up your wp-config.php and add the following line:-

define('FS_METHOD', 'direct');

That will eradicate the issues with prompt for FTP credentials when uploading, but it's not going to give your permissions to update/upload etc.

2. Open up MAMP Pro and go to the 'General' tab and where you see "Run Apache/MySQL server as user:' dropdown and change the www / (Apache) / mysql (MySQL) to your-user / variant.

The above gives you/your user account direct permissions to read/write to the folders within your MAMP sites.

2. You are connecting your localhost development site to the Internet with Dynamic DNS

So unlike the above you want to allow your site to be viewable on www and are not working locally.

1.As before we follow Step 1 above to remove the need for FTP when updating plugins, themes etc
2. In MAMP go to your 'Hosts' tab and click on the host you want to allow 'www' access for (actually MAMP uses the equivalent user '_www'
3. Click on the permissions icon next to the 'Document Root'
4. Go ahead and change the Owner and Group (the latter allows uploads) to '_www' and hit 'OK'. This is shown 'set' below:-

mamp-permissions-1

Option: You may also set Group to 'admin' for more restricted access rights.You will now be able to upload, update etc in Wordpress

Please be sure that for a 'live', rather than development, site that you check all your permissions are set correctly on folders. We recommend iThemes Security Pro for toughening up your Wordpress live site and checking permissions etc.

3. You want to use 'www' on localhost and just want to upload files / change permissions on a folder by folder basis | Also Applies to OS X Server

1.As before we follow Step 1 above to remove the need for FTP when updating plugins, themes etc
2. Select the folder that you need to allow www access to. For example for uploading (as per this requirement) select the 'wp-content' folder
3. On you mac hit 'cmd + i' (Command I) which brings up the file info and 'Sharing & Permissions' and here you will see the users that can access the folder. Given that you have a permissions issue with uploads what you probably won't see is the Owner '_www' as used by MAMP
4. Unlock the padlock (bottom right) and authenticate if necessary and click the plus '+" button in the bottom left corner whilst also holding down Option ('alt'). This will show you the system users and groups (rather than just the standard user with just the + button click)
5. Scroll down towards the bottom and select 'World Wide Web Server'. There are 2 and the are the Owner and Group for www. Select them both and click 'Select'. They will now appear in your folder permissions.
6. Set the Owner _www (one head) to 'Read & Write' and set the Group _www (2 heads) to 'Read Only' as per the below:-

mamp-permissions-2

You will now have sufficient Apache www user read/write access to upload to your Wordpress site.

NB I haven't tested read/write for all Wordpress folders (necessary for updating plugins etc) as I am happy with Step 1 or 2 above for local/development testing purposes. This is more a point of interest for me.

3a How to change folder permissions to be writeable by your User | Also Applies to OS X Server

As the _www user is the owner of the folders in both MAMP and OS X Server you may like me find it tedious that you have to constantly authenticate files when editing them. One approach is to make your user the Apache user.

Change the user from _www to your own user

Open Terminal and Enter

sudo nano /private/etc/apache2/httpd.conf

Find and change http.conf code from

User _www
Group _www

To

User your_mac_username
Group staff

Restart apache

sudo apachectl restart

A double pronged approach - Keep the Apache _www user and add your own user permissions | Also Applies to OS X Server

I like to keep the _www user to the owner, but also add my own user is to modify files without authentication and to do this don't make the above changes and simply revert back to our approach in item 3 above.

1. Select the parent folder
2. On you mac hit 'cmd + i' (Command I) which brings up the file info and 'Sharing & Permissions' and here you can select your own user
3. Give your user Read/Write privileges and but then drop down the cog button at the bottom and then select  'Apply to enclosed items'.

This will give your user full read/write permissions as well as keeping the _www Read & Write intact.