Plugin Upgrade Failing, Cannot Remove Old Plugin (25 posts)

  1. chazbeaner
    Posted 6 years ago #

    I have searched around on the forums and Google and have been unable to find a solution to my particular issue.

    When trying to automatically upgrade plugins I get the following:

    Downloading update from http://downloads.wordpress.org/plugin/stats.1.3.8.zip

    Unpacking the update

    Deactivating the plugin

    Removing the old version of the plugin

    Could not remove the old plugin

    Plugin upgrade Failed

    I have used both my FTP URL and "localhost" as the Hostname for the connection, neither works. Username and password are correct as I can manually upgrade the plugins, which is time-consuming and what I'm hoping to avoid.

    I have chmod the permissions on the wp-content, upgrade and plugins folders to 777 and 775 and every combination therein.

    As you can see, the plugin that is failing is the WP Stats plugin, so I don't think it's a plugin issue as it also happens for the other 5 plugins I need to update.


  2. Check the file permissions on the files in WP Stats. Sometimes images get weird permissions and don't update right.

  3. chazbeaner
    Posted 6 years ago #

    i can give that a shot, but the issue happens when trying to upgrade any of 5 different plugins. Could there be a permissions issue in all of my plugin folders? Can I just chmod the stats folder to 777 and make recursive and see if that will work?

  4. It's likely a permissions issue or a server config issue. Did it ever work?

  5. chazbeaner
    Posted 6 years ago #

    I went in and made 777 recursive through the entire plugin folder and the upgrade still failed with the same message.

  6. GlitterKill
    Posted 6 years ago #

    Did you ever figure out a fix for the problem?

  7. swiss420
    Posted 6 years ago #

    Got the same problem it downloads the plugin to /wp-content/upgrade/pluginname/pluginname/ but fails to move it to the plugins directory to activate it again. This behaviour happens for me since upgrading to 2.8.0 and persisted through 2.8.2. Anyone got any hints toward the solution. Permissions on the plugin directory are fine. It must be other permissions.

  8. 3ukman
    Posted 6 years ago #

    I see the same issue on 2.8 running on IIS 7 , all file permissions granted. Any other permission needing setup ?

  9. Greg Boggs
    Posted 6 years ago #

    I too have this problem on several servers. I am the system administrator and I have root access.

    Why are there no guides for system administrators on how to setup web servers to make WordPress run smoothly?

    I had trouble with automatic upgrades for a year, until I did a chown -R www-data:www-data /var/www/mysite/html

    That gave wordpress permission to do the upgrade, but it broke FTP access for the mysite account because it is no longer the owner of the files.

    This chown fix did not resolve the "cannot delete" plugins. Installing plugins automatically works, but upgrading fails.

    It would be nice to have a how to guide for setting up apache for wordpress to work, and it would be nicer if WordPress would just Work, or fail gracefully with useful error messages.

  10. elizabethrichardson
    Posted 6 years ago #

    My automatic upgrades didn't work for a variety of plugins and I fixed it by deleting the plugin files completely and uploading manually. wp-admin and wp-includes also needed to be deleted and reinstalled manually...just overwriting the files wasn't good enough.

    All auto upgrades work perfectly now.

  11. lindafar
    Posted 6 years ago #

    I too am having problems getting anything to update.

    I've changed all permission settings to 777, but it hasn't helped.

    For instance I get this type of error message, it always seems to be a file that can't be copied:

    Downloading update from http://downloads.wordpress.org/plugin/tweet-this.1.6.1.zip.
    Unpacking the update.
    Could not copy file /public_html/wp-content/upgrade/tweet-this.1.6.1/tweet-this/languages/tweet-this.mo

    Very frustrating!

  12. lindafar
    Posted 6 years ago #

    Just tried another one and got this:

    Downloading update from http://downloads.wordpress.org/plugin/sociable.3.5.1.zip.
    Unpacking the update.
    Installing the latest version.
    Removing the old version of the plugin.
    Could not remove the old plugin.
    Plugin upgrade Failed.

    So I'm getting a variety of error messages.

    Needless to say, I don't want to upgrade WordPress with this type of situation going on.

  13. horncreek
    Posted 6 years ago #

    I just did a new install on a new host and Akismet installed properly but when I tried to install other plugins from the plugins page, it failed. When I checked the site files, it appears that the plugins downloaded and unpacked in the wp-content/plugins directory OK but they do not show up on the blog admin plugins list. Any clues? I'm lost on this one.

  14. horncreek
    Posted 6 years ago #

    OK, I did some more checking and it appears that the plugins did not fully unpack. I found there were missing files in the folders for both plugins I had tried to install. This was the case even though I had allowed over 5 minutes for each plugin to download and install.
    So I downloaded the .zip to my computer, unzipped and FTP'd to the server and then I was able to activate the plugins. But I have no explanation for the fact that they didn't do the autoinstall properly. What would cause them to only partially unzip? Or unzip and lose files. Weird.

  15. detroiter
    Posted 6 years ago #

    I'm having the exact same problem as lindafar above.

    It doesn't give me the same error every time. Sometimes it will be "cannot remove old plugin" and sometimes it will be "cannot copy file".

    The weird thing is that it used to work fine and then all of a sudden it didn't work at all.

    It seems the problem is also affecting the uploading of new plugins as I tried to manually update the plugins. Similar error messages and inordinate amount of time waiting for it to complete.

  16. physalis
    Posted 6 years ago #

    Is there a simple solution to this "could not remove old plugin" problem? Seems the other ones may be of a different kind, since I am only having the error message above & all other upgrades (i.e. WordPress itself) work fine all the way...

  17. detroiter
    Posted 6 years ago #

    I've narrowed down the problem even more.

    The automatic upgrade will work but only after three tries.

    The first time it usually says could not remove old plugin.

    The second time it says could not activate new plugin.

    The third time it works and gives me the activate plugin link.

    It seems as though it takes an inordinately long time each time I try the auto update, takes around 4 minutes to successfully upgrade since I have to do it 3 times.

  18. detroiter
    Posted 6 years ago #

    Oh and btw I run two blogs on the same host and this is the same for both of them.

  19. detroiter
    Posted 6 years ago #


  20. detroiter
    Posted 6 years ago #

    Looks like I figured out a solution others may want to try.

    1. Make sure your wp-config.php file is chmodded to 0644.

    2. Also make sure your .htaccess file is protecting the wp-config file using these lines:

    <Files wp-config.php>
    order allow,deny
    deny from all

    3. Backup your wp-config.php file.

    4. Edit your wp-config.php file putting these lines in underneath <?php:

    define('FS_METHOD', 'ftpsockets');
    define('FTP_BASE', '/path/to/wordpress/');
    define('FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/');
    define('FTP_PLUGIN_DIR ', '/path/to/wordpress/wp-content/plugins/');
    define('FTP_USER', 'username');
    define('FTP_PASS', 'password');
    define('FTP_HOST', 'ftp.example.org');


    WordPress no longer asks me for FTP details and it seems that everything is now working as it should be as far as automatic upgrade/install of plugins.

    Make sure you leave the port (:21) off the FTP_HOST line.

  21. cosmictap
    Posted 6 years ago #

    Thanks Detroiter for all your efforts here. I tried your config edits and I still am getting failed upgrades. This is really frustrating!

  22. David Radovanovic
    Posted 6 years ago #

    This has been a big issue for a long time. Thank you detroiter!!

  23. Pius Ekhaeyemhe
    Posted 6 years ago #

    Detroiter, I followed your steps and it took care of the problem. Thanks for your help!


  24. Marc
    Posted 6 years ago #

    Make sure that you didn't reach your site's quota for disk space. That was my problem. Cleaned up my server space and the problem went away.

  25. goddess_dix
    Posted 5 years ago #

    detrioter, thank you for the info. it helped me.

Topic Closed

This topic has been closed to new replies.

About this Topic