It’s been the bane of my WordPress life: every time I get a notification of updates available on my local installation (on my MacBook Pro), either for the WordPress core, or one of my installed plugins, I get a request for FTP parameters. This, I’ve learned, is due to WordPress trying to write a small test file to the wp-content directory. When it fails, it reverts to trying to get the files via FTP. But, sadly, I don’t have FTP setup on my local install. Besides, from what I hear, this method seldom works.
Don’t despair, though: there is a solution. And it’s fairly simple. (Don’t be put off if you’re not familiar with the OSX Terminal: it’s not that complicated. Really.)
The reason WP fails writing this file is because the webserver (Apache in this case) is running with a different user and group than the wp-content directory. So, you change the webserver’s user and group to wp-content’s, and WordPress can then write to the directory.
The first step is to determine your wp-content folder’s user and group. Open the OSX Terminal (under /Applications/utilities), and navigate to your wordpress directory using the cd and ls commands. Mine is at /Sites/wp_dev/wordpress. This is what it looks like:
As you can see, the wp-content directory is owned by user alfred and group staff. Make a note of your’s.
Now we move on to the second step. Simply open up XAMPP’s httpd.conf file in an editor (under /Applications/XAMPP/xamppfiles/etc) and find the following:
# # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. # # User/Group: The name (or #number) of the user/group to run httpd as. # It is usually good practice to create a dedicated user and group for # running httpd, as with most system services. # User nobody Group nogroup
Your line numbers may vary. Change the user and group specified to your’s, and save the file.
Finally, restart Apache from the XAMPP Control app at /Applications/XAMPP. Next time an update comes up, you’ll be good to go!