Automaticly upgrade your local WordPress installation

This will only work with Mac OS X and Apache.

I have many WordPress installations locally. All of which grows outdated as time flies by. Normally I don’t worry about it since the live version is easily upgraded with WordPress automatic upgrade. But as of lately, I want to do this locally. But when I try to, WordPress asks for FTP-credentials.

So here is how you can bypass it.

First of all, add the following lines to your wp-config.php

define('FS_METHOD', 'direct');
define('WP_TEMP_DIR', ABSPATH.'wp-content/tmp');

Create a folder called tmp in your wp-content folder and make both of them writable.

Now, whenever you want to do an upgrade do the following steps:

  • Fire up Terminal and browse to your WordPress folder
  • Change ownership of the WordPress files to your Apache user. By default your user is called _www, as well as your group.
    sudo chown -R apacheuser:apachegroup .
  • Do the automatic upgrade!
  • When you are finished revert the ownership back to yourself
    sudo chown -R yourmacuser .

I have seen other blog posts about this, but all of them involved changing a lot of file permissions, which I didn’t feel comfortable with. So I follow these steps every upgrade and it works pretty well!

Advertisements
About

Web Developer @ Oakwood Creative - www.oakwood.se

Tagged with: ,
Posted in Intermediate, Misc
One comment on “Automaticly upgrade your local WordPress installation
  1. vlad says:

    Downloading update from http://wordpress.org/wordpress-3.8.1-new-bundled.zip…

    Unpacking the update…

    Could not create directory.: /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/upgrade/wordpress-3.tmp

    Installation Failed

    this is what i get

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

About

WordPress Quick Tips is a blog supplying great tips about WordPress.

We hope to create a great knowledge resource for WordPress developers as well as serving a reminder for all the forgetful ones.

The blog is created and run by Vincent of Oakwood Creative

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 120 other followers

%d bloggers like this: