Recently I switched some of my accounts over to http://www.hostgatordiscounts.org in order to get around some of the resource limits I was facing on a standard shared hosting plan. There was some hassle in moving the accounts over (including having to register the IP addresses of my new nameservers with my domain registrar, something I didn’t expect to have to do and was more complicated than I expected) but on the whole it was a positive move because the hosting service stopped suspending accounts for resource overuse.
One of the unexpected side effects of this move, however, was that my WordPress blogs (existing and new) could no longer automatically update themselves. Whenever I tried to:
- Upgrade to a new version of WordPress;
- Install or upgrade a plugin; or
- Install a new theme
I was presented with a form that asked for my FTP credentials for the site. Why? Because in the new VPS setup the web server no longer had permission to modify files belonging to individual user accounts. The only thing it could do was use FTP to access the site, a much slower and more error-prone process than the standard WordPress upgrade mechanism.
One solution was to change the file and directory permissions to give all users in the VPS read, write and execute permissions, but that’s definitely overkill and a big security hole waiting to be exploited.
The better and easier solution is to install suPHP< on the virtual server. It may in fact be already there, but not enabled. But if it’s not there, your hosting service can quickly install it. (You can also do it yourself if you want, but it will usually be quicker to let the hosting service do it for you.)
Once suPHP is installed, modify your Apache configuration to use suPHP as the PHP5 and PHP4 handler, like so:
Restart the web server and you’re done… you should now be able to upgrade WordPress and install plugins and themes without having to supply FTP credentials. Managing your installation is suddenly a lot easier!