admin管理员组

文章数量:1295272

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

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

Share Improve this question edited Mar 20, 2017 at 10:31 fuxia 107k38 gold badges255 silver badges459 bronze badges asked Mar 20, 2017 at 10:29 AniketAniket 1712 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

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.

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.

本文标签: wp cliUnable to install plugins from wpcli