gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 16:50:54 24 4
gpt4 key购买 nike

在 Ubuntu 上使用一个新的 Wordpress 实例,我通过 these instructions 安装了 wp-cli .我试过 downloading the .phar package, chmodding it, etc .我也试过installing a .deb package .在这两种情况下,我在运行 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.

我已经完成了 list of support options而且我仍然无法让 wp-cli 在 AWS Lightsail(又名 Bitnami)上正常工作。看着 githubwordpress.org forums ,我看到很多用户都遇到过上述部分或全部错误。我尝试了所有建议的解决方法:

  • wp-config.php:将 ABSPATH 行包装在条件中。
  • wp-config.php:将 add_filter() 调用移动到 MU 插件中。
  • 几个 chmodchown 更改。

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

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

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

最佳答案

我在那里看到了两个不同的问题。

  1. 您在 wp-config.php 文件中使用了 $_SERVER['HTTP_HOST'],在运行 WP-CLI 时未设置。由于 WP-CLI 作为命令行工具,一些仅用于网络的 PHP 常量/变量是没有设置。您需要手动设置这些或提供条件覆盖。

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

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

关于wordpress - WP-CLI 是否与 AWS Lightsail 上的 Bitnami Wordpress 安装不兼容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46823879/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com