Hi I am using a Ubuntu system. I am using a shell script to download wordpress from wget, update config and run it from nginx server.

Now I want to update this shell script so that when we install a fresh copy of WordPress, I get some plugins pre-installed. So I installed wp-cli and ran the command

wp plugin install w3-total-cache --activate --allow-root

This command says the plugin has been activated successfully. But when I go to the site URL in the plugins section, it gives the following error

The plugin w3-total-cache/w3-total-cache.php has been deactivated due to an error: Plugin file does not exist.

This is true for any plugin that I try to install.

When I go to the plugins folder inside wp-content, I can see that plugin files exist. But still I get the error.

How to resolve this. Please help

2 Answers 2


Caching plugins usually require some additional manual work in moving some files from the plugin directory to the root of the wp-content directory and maybe some wp-config.php changes. It is possible that the plugin fails to initialize due to that.

  • 1
    So is there any solution to it? Can you please tell me what all files I have to move/edit.
    – Aniket
    Mar 20, 2017 at 15:18

I've had this exact issue, and I found the very specific issue.

WP-CLI was running in another directory (with another Wordpress installation) which pointed to the same database.

What happens:

  1. WP-CLI succesfully executes the command on the wrong Wordpress installation
  2. You then open the correct Wordpress installation, and go to Plugins.
  3. That installation cannot find the file so it deactivates the plugin.

The issue for me was caused by using a setup script which used the --path= option, and this path was wrong. The setup script fully installed Wordpress in the wrong directory with the same database credentials.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.