Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not remove the old plugin

I'm trying to update the plugins on my clients site and I'm getting this error for multiple plugins. He's using plesk.

Downloading update from https://downloads.wordpress.org/plugin/awesometastic.131026.zip…
Unpacking the update…
Installing the latest version…
Removing the old version of the plugin…
Plugin update failed.


An error occurred while updating Awesometastic Plugin: Could not remove the old plugin.

I'm sure it's got something to do with directory permissions, although, could someone explain to me what the possible issues are and how to fix this?

Thanks!

like image 677
Nick Res Avatar asked Dec 08 '22 11:12

Nick Res


2 Answers

It's a permissions issue. Run this on SSH:

chmod -R 0755 /var/www/<yourpathtowordpress>/wp-content/plugins

chown -R www-data /var/www/<yourpathtowordpress>/wp-content/plugins

The first grants writing permissions, while the second ensures the user who needs the permission is correctly set

like image 101
George Avatar answered Dec 25 '22 18:12

George


WordPress does not display OS level errors by default but this is most definitely a permission issue on your plugins folders in your site's wp-content/plugins.

You could enable debugging in order to see the original error which triggered the more generic one you've seen if you want to work with a better view of the world.

Multiple debugging options are documented in WordPress' online manual. To enable debugging and log messages set the following variables in wp-config.php:

  1. Enable debugging via WP_DEBUG
    • define('WP_DEBUG', true);
  2. Enable logging debug messages to the /wp-content/debug.log file with WP_DEBUG_LOG
    • define('WP_DEBUG_LOG', true);

You should probably make sure to disable these options and delete the debug.log file after gathering enough information as they could contain server information you do not want to be accessible publicly through your WordPress installation.

Alternatively we can try to guess what the most plausible cause can be:

If you installed your plugins manually on the server and not via the WordPress administration console it is likely you did it as a different user then the one who is executing WordPress' PHP code and thus requires proper access to perform such OS operations.

Finally the solution may be to fix the permissions or upgrade the plugins manually.

like image 37
3 revs Avatar answered Dec 25 '22 16:12

3 revs