The Issue: No WordPress updates on localhost
If you’re using a tool like MAMP or XAMP (etc.) to locally host development WordPress sites, you may have noticed you can’t run regular updates on the WordPress core, and can’t install plug-ins and themes from the repository. Quite likely WordPress is prompting you for FTP credentials, and it might also give an error related to not being able to create a directory, etc.
There are two issues. When is the FTP issue, the other is the permission issues.
If, whilst attempting to update your localhost WordPress, you get a message requesting FTP credentials (like the one above), you need to add the following to your wp-config.php file.
Just put it somewhere near the top of the file.
On Mac OS X it’s normally the case that Apache runs under the username _www . But MAMP (etc.) leave typically have your username (if that’s the one you used to run it) as the owner of the files. You’ll need to change the user to _www . Use these commands at the command line (in Terminal.app or iTerm, or what ever command line interface you like to use).
sudo chown -R _www wp-dir
sudo chmod -R g+w wp-dir
So, you need to change directory to the parent folder of your WordPress installation. You are then changing the owner and permissions on the WordPress installation folder (I’ve used wp-dir in my example, and you’ll need to replace that with your WP installation folder name).
Under normal circumstances, you should now be able to run updates and installs on your local WordPress instance.