Updating WordPress Plugins Locally, Without FTP

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!

8 thoughts on “Updating WordPress Plugins Locally, Without FTP

  1. Pingback: Stop WordPress from asking for FTP information for local development | King Luddite

  2. Pingback: AisleConnect – Wordpress Plug-In Installation without FTP

  3. Great tip! In my case I installed apache, mysql and php one by one, not used xampp or lampp, how to solve this problem? Sorry for my bad english, I’m Brazilian.

    • Glad you liked it, Netto. Installing Apache, MySQL and PHP manually doesn’t affect this procedure. But you will have to find your Apache’s configuration file (httpd.conf), and you’ll need to restart Apache (probably with /etc/init.d/apache2 restart).

      Best of luck, and let us know how you made out. (And BTW, your English was perfect.)

  4. Yup, this worked for me! So far, at least. I have several development folders running in a Sites folder using Mac’s native Apache/PHP with MySQL added.

    In Terminal, take a look at your Apache httpd.conf by using this command:

    cat /etc/apache2/httpd.conf

    The User/Group lines are right down below all the LoadModule stuff. Yes, mine were mismatched — it had “_www” for both.

    Then I edited the file in Terminal (I used pico editor) to change those lines as Alfred explained.

    Then restarted Apache — in Terminal, I just used: sudo apachectl restart

    Presto! Updated and installed WordPress plugins with no problem.

    Excellent! Thank you, Alfred. This has been buggin me for so long … 🙂

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.