尝试在wp-cli上使用woocommerce命令-获得''wc'并不是注册的wp命令。

时间:2019-04-03 20:06:31

标签: wordpress woocommerce wp-cli

我正在使用ubuntu计算机,并已按照官方安装说明在全球范围内安装了wp-cli。但是,我无法运行任何woocommerce命令。它们都触发相同的错误:

Error: 'wc' is not a registered wp command.

这是我的wp cli命令的结果:

OS:     Linux 4.15.0-46-generic #49-Ubuntu SMP Wed Feb 6 09:33:07 UTC 2019 x86_64
Shell:  /bin/bash
PHP binary:     /usr/bin/php
PHP version:    7.2.16-1+ubuntu18.04.1+deb.sury.org+1
php.ini used:   /etc/php/7.2/cli/php.ini
WP-CLI root dir:        /home/officedev/.composer/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      /home/officedev/.composer/vendor
WP_CLI phar path:
WP-CLI packages dir:    /home/officedev/.wp-cli/packages/
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.1.0

有人可以帮我看看这里缺少什么吗?谢谢!

2 个答案:

答案 0 :(得分:0)

我很抱歉,我不知为何没有激活woocommerce插件。在这种情况下,只会将wp wc命令添加到wp cli中。

答案 1 :(得分:0)

您必须安装并激活插件...

$ wp wc
Error: 'wc' is not a registered wp command. See 'wp help' for available commands.
Did you mean 'db'?
$ wp plugin install woocommerce
...
$
$ wp wc
Error: 'wc' is not a registered wp command. See 'wp help' for available commands.
Did you mean 'db'?
$
$ wp plugin  activate woocommerce
Plugin 'woocommerce' activated.
Success: Activated 1 of 1 plugins.
$ wp wc
usage: wp wc customer <command>
   or: wp wc customer_download <command>
   or: wp wc order_note <command>
   or: wp wc payment_gateway <command>
   or: wp wc product <command>
   or: wp wc product_attribute <command>
   or: wp wc product_attribute_term <command>
   or: wp wc product_cat <command>
   or: wp wc product_review <command>
   or: wp wc product_shipping_class <command>
   or: wp wc product_tag <command>
   or: wp wc product_variation <command>
   or: wp wc shipping_method <command>
   or: wp wc shipping_zone <command>
   or: wp wc shipping_zone_location <command>
   or: wp wc shipping_zone_method <command>
   or: wp wc shop_coupon <command>
   or: wp wc shop_order <command>
   or: wp wc shop_order_refund <command>
   or: wp wc tax <command>
   or: wp wc tax_class <command>
   or: wp wc tool <command>
   or: wp wc tracker <command>
   or: wp wc update
   or: wp wc webhook <command>
   or: wp wc webhook_delivery <command>

See 'wp help wc <command>' for more information on a specific command.
$