WP-CLI与AWS Lightsail上的Bitnami的Wordpress安装不兼容吗?

Luk*_*ard 4 wordpress ubuntu bitnami wp-cli amazon-lightsail

在Ubuntu上使用Wordpress的新实例,我wp-cli通过这些说明安装.我尝试下载.phar包,chmodding等等.我也尝试安装.deb包.在这两种情况下,运行时都会遇到相同的错误wp plugin update --all --debug:

Debug (bootstrap): No readable global config found (0.057s)
Debug (bootstrap): No project config found (0.057s)
Debug (bootstrap): argv: /usr/local/bin/wp plugin update --all --debug (0.057s)
Debug (bootstrap): ABSPATH defined: /opt/bitnami/apps/wordpress/htdocs/ (0.058s)
Debug (bootstrap): Begin WordPress load (0.058s)
Debug (bootstrap): wp-config.php path: /opt/bitnami/apps/wordpress/htdocs/wp-config.php (0.058s)
PHP Notice:  Undefined index: HTTP_HOST in phar:///usr/local/bin/wp/php/WP_CLI/Runner.php(1070) : eval()'d code on line 90
PHP Notice:  Undefined index: HTTP_HOST in phar:///usr/local/bin/wp/php/WP_CLI/Runner.php(1070) : eval()'d code on line 91
Debug (bootstrap): Loaded WordPress (0.188s)
Debug (bootstrap): Running command: plugin update (0.188s)
Downloading update from https://downloads.wordpress.org/plugin/akismet.4.0.zip...
Using cached file '/home/bitnami/.wp-cli/cache/plugin/akismet-4.0.zip'...
Unpacking the update...
Warning: Could not create directory.
Downloading update from https://downloads.wordpress.org/plugin/all-in-one-wp-migration.6.58.zip...
Using cached file '/home/bitnami/.wp-cli/cache/plugin/all-in-one-wp-migration-6.58.zip'...
Unpacking the update...
Warning: Could not create directory.
Downloading update from https://downloads.wordpress.org/plugin/all-in-one-seo-pack.2.4.2.zip...
Using cached file '/home/bitnami/.wp-cli/cache/plugin/all-in-one-seo-pack-2.4.2.zip'...
Unpacking the update...
Warning: Could not create directory.
Downloading update from https://downloads.wordpress.org/plugin/google-analytics-for-wordpress.6.2.4.zip...
Using cached file '/home/bitnami/.wp-cli/cache/plugin/google-analytics-for-wordpress-6.2.4.zip'...
Unpacking the update...
Warning: Could not create directory.
Downloading update from https://downloads.wordpress.org/plugin/jetpack.5.4.zip...
Using cached file '/home/bitnami/.wp-cli/cache/plugin/jetpack-5.4.zip'...
Unpacking the update...
Warning: Could not create directory.
+--------------------------------+-------------+-------------+--------+
| name                           | old_version | new_version | status |
+--------------------------------+-------------+-------------+--------+
| akismet                        | 3.3.4       | 4.0         | Error  |
| all-in-one-wp-migration        | 6.55        | 6.58        | Error  |
| all-in-one-seo-pack            | 2.3.15      | 2.4.2       | Error  |
| google-analytics-for-wordpress | 6.2.0       | 6.2.4       | Error  |
| jetpack                        | 5.2.1       | 5.4         | Error  |
+--------------------------------+-------------+-------------+--------+
Success: Plugins already updated.
Run Code Online (Sandbox Code Playgroud)

我已经浏览了支持选项列表,我仍然无法让wp-cli在AWS Lightsail上工作正常,也就是Bitnami.看看githubwordpress.org论坛,我看到很多用户都有上述部分或全部错误.我尝试了所有建议的解决方法:

  • wp-config.php:将ABSPATH行包装在条件中.
  • wp-config.php:将add_filter()呼叫移动到MU插件.
  • 几个chmodchown变化.

其中一些确实使他们各自的错误消失了,但wp仍然无法更新插件等.

我是否需要创建PHP调试输出中标识的丢失文件?

我应该不使用AWS Lightsail/Bitnami吗?我真的需要wp-cli,所以我愿意转移到ec2或其他任何东西.

小智 5

我在那看到两个不同的问题.

  1. 您正在使用$_SERVER['HTTP_HOST']wp-config.php文件中,在运行WP-CLI时未设置该文件.由于WP-CLI作为命令行工具运行,因此未设置某些仅限Web的常量/变量.您需要手动设置它们或提供条件覆盖.

  2. WordPress本身无法创建一个解压缩下载的插件存档文件的目录.这可能是由于上面的1.(因为WordPress可能在错误的位置查找),或者它可能是一个不相关的问题,例如使用不具有所需权限的其他用户运行WP-CLI.

这两个问题不是由WP-CLI直接引起的,而是由WordPress安装的特定设置引起的.