How to upgrade WordPress and plugins without FTP

I’ve read so many forum threads on this that I think it’s time to share these very simple instructions. Follow them for your website and you’ll finally have the fully automatic updates working as they should.

Automaitic WordPress and plugin updates

First of all, let’s just make sure we’re talking about the same thing.  Since version 2.7, WordPress received one of the most useful features ever: automatic update. What this means is that every time a new version of WordPress is released, you now get a “click here to upgrade” option in your admin dashboard. When you click the link, it should ask for a confirmation and then proceed with automatic downloading and upgrading of your blog. But because of misconfigurations, this feature isn’t always working, and then you end up with a configuration dialog suggesting that you provide FTP credentials for accessing your server.

Possible reasons for automatic WordPress upgrade not working

There’s only a few reasons why WordPress or plugins upgrade feature will not work.

1. You’ve upgraded from older versions of WordPress

… and therefore don’t have the right configuration setting in your wp-config.php. Just add this to it:

define(‘FS_METHOD’,’direct’);2

2. Your blog is stored in a directory which webserver can’t update.

Quite often this is a result of someone (host administrator) installing you a new blog, but mistakenly leaving all the files owned by their own user or root (superuser). Since webserver software is running as something else (webservd in Linux distributions, or sometimes even user nobody), the software can read blog files but can’t overwrite them. Obviously, overwriting files is kind of critical for any upgrade process, so this scenario will result in automatic upgrades failure.

How would you fix this issue? Easy! If you have command line access to your hosting server, become root and change ownership of your blog’s files.

Assuming that your webserver runs as webservd user, and that your blog is in the /var/www/myblog.com directory, here’s a command line that will do the trick:

# chown -R webservd:webservd /var/www/myblog.com

3. Some files in your blog’s directory are read-only

This means that even if files belong to the user that your webserver is running as, there is still a chance that some files won’t be possible to overwrite because they have the read-only attribute (or read-only permission).

Fixing this from a command line isn’t hard at all. Assuming the same /var/www/myblog.com location, here’s what you should do:

# chmod -R ug+w /var/www/myblog.com

That’s it, I hope you liked this tutorial. Do ask questions in comments so that I can expand this article and make it most useful to all the future visitors!

 

Speak Your Mind

*

For spam filtering purposes, please copy the number 4739 to the field below: