Getting Wordpress Automatic Plugin Upgrade to Work
Filed Under (Techie) by Cynthia on Dec 14, 2008 6:11 pm
Tagged Under : Tech
I hate it when things don’t work. Pisses me off. Which is, actually, a good feature of a programmer and it’s why I’m fairly good at figuring out problems with my job.
Ever since about Wordpress 2.5, probably ever since it’s been included in Wordpress, two of my blogs would let me automatically upgrade the plugins, and the rest would not. Of course this has been driving me batty because, basically, I’m lazy and I don’t want to have to upload my plugins to my VPS every stinking time they need upgrading. And that is quite often, actually. I just upgraded to Wordpress 2.7 and I was hoping the issue would be fixed. Apparently it was not.
So off to Google I went to find out what in the world is going on. Finally I figured them all out.
This Site has the best information to fix the plugin upgrades. Keith’s Automatic Plugin Info Page. Of course, though, it didn’t work on all the blogs on my VPS that needed fixing. But it did work on most. The ones it didn’t work on I just had to adjust the information a little bit. Like one of them didn’t need the modification to the files.php file.. though I really don’t know why.
Anywho, even though I’m repeating what he says, I’m going to post here what I did to fix this so that I know for in the future when I have to apply it to every single new version of Wordpress that comes out, which is a pain in the rear, but I’ll do it because I hate it when things don’t work. Oh also.. I do not have FTP on my VPS, and I really don’t want to install an FTP server on my VPS because it’s just one more security hole that I really don’t need.
Here’s the process:
- I adjust the permissions for the entire Wordpress installation. I do wish I knew the proper and correct permissions settings, but you might want to try your own. If you need to, you can change everything to 777 temporarily for this to work, and then change back to 755 or whatever usually use. I would love for someone to tell me exactly what I need permissions on all directories and files to be… but I haven’t found a good easy to understand tutorial about it yet. And the WP codex page doesn’t help me one swat.
- Second I open the config.php file and add the following lines:
define(‘FTP_SSL’, false);
This is to force Wordpress not to use FTP for, like me, servers that don’t have FTP installed. And I cannot word it as well as the guy who commented on this post:
There is a bug with WordPress 2.5.0 and 2.5.1 where the setting to use FTP over SSL can not be deactivated once activated. So no matter what changes you make to the config page in the GUI, it will not work. The only way to override that setting is to set FTP_SSL to False in the wp-config.php file as you mention above.
So to get this to work, the above is necessary. And I found it so in all of my Wordpress installations.
- I added the following line also to wp-config.php:
define(‘WP_TEMP_DIR’, ABSPATH . ‘wp-content/upgrade’);
This forces Wordpress to use the directory wp-content/upgrade to write temporary files needed for the plugin upgrades. At this point I saved wp-config.php and went on to create the the upgrade directory.
- I went in and created a wp-content/upgrade directory. In addition to creating the directory you’ll need to set the permissions (777?), and also set the group to apache. Apache needs to be able to write to this subdirectory.
- Finally, and this is the step that I sometimes needed, sometimes did not. I opened the wp-admin/includes/file.php file and made the following changes:
I searched for getmyuid(). There are two instances of getmyuid() in file.php. The first one is in the if statement that looks for the function getmyuid(). That one remains the same. It is something like if( function_exists(‘getmyuid’) && function_exists(‘fileowner’) ) {
inside that if statement, however, you’ll find it again:
if ( getmyuid() == fileowner($tempFile) ) {
that needs to be changed to:
if ( posix_getuid() == fileowner($tempFile) ) {
For more information on this change, please refer here as he describes it better than I can!
If you do all these things… then the automatic plugin upgrade in Wordpress 2.7 should work. It is working for me, now, on all of my blogs. Finally! Of course it will be a pain to make these changes every time Wordpress upgrades. But I’m willing to do it, since I hose a number of blogs and it’s easier to do this fix than it is to upload all the new plugin versions to my VPS when they update.
On this day..
- I'm Really Good At Watching TV - 2009
- A Caribbean Cruise!!! - 2007
- You Couldn’t Pay me Enough to Keep Working - 2007









Hmm, I had been toying with the idea of hosting my own WordPress installation, but I think you just cured me …
Dennis the Vizslas last blog post..is it stil a windo seet if its not in the windo?
Oh but hosting a Wordpress blog is actually really fun! I like digging in there though, and figuring stuff out, and being owner of all my files and data. I guess I’m a bit of a control freak. I highly recommend self hosing a Wordpress blog instead of doing the hosted type, I enjoy it!