admin管理员组文章数量:1426631
Working within a Docker container (circleci/php:latest) and I'm struggling with wp-cli a bit. When I attempt to run wp core install
I get a silent failure with 255 exit code. I enabled --debug hoping to get some more information but unfortunately all I can see is that it stops after reading wp-config.php.
circleci@142b5627c098:~/wordpress$ wp core install --url=example --title="Example" --admin_user=admin [email protected] --skip-email --debug
Debug (bootstrap): Fallback autoloader paths: phar://wp-cli.phar/vendor/autoload.php (0.01s)
Debug (bootstrap): Loading detected autoloader: phar://wp-cli.phar/vendor/autoload.php (0.011s)
Debug (commands): Adding command: cache (0.015s)
Debug (commands): Adding command: transient (0.017s)
Debug (commands): Adding command: comment (0.019s)
Debug (commands): Adding command: meta in comment Namespace (0.02s)
Debug (commands): Adding command: menu (0.021s)
Debug (commands): Adding command: item in menu Namespace (0.022s)
Debug (commands): Adding command: location in menu Namespace (0.022s)
Debug (commands): Deferring command: network meta (0.023s)
Debug (commands): Adding command: option (0.024s)
Debug (commands): Adding command: post (0.026s)
Debug (commands): Adding command: meta in post Namespace (0.026s)
Debug (commands): Adding command: term in post Namespace (0.027s)
Debug (commands): Adding command: post-type (0.028s)
Debug (commands): Adding command: site (0.03s)
Debug (commands): Adding command: meta in site Namespace (0.031s)
Debug (commands): Adding command: option in site Namespace (0.032s)
Debug (commands): Adding command: taxonomy (0.033s)
Debug (commands): Adding command: term (0.034s)
Debug (commands): Adding command: meta in term Namespace (0.035s)
Debug (commands): Adding command: user (0.037s)
Debug (commands): Adding command: meta in user Namespace (0.038s)
Debug (commands): Adding command: session in user Namespace (0.039s)
Debug (commands): Adding command: term in user Namespace (0.04s)
Debug (commands): Adding command: network (0.04s)
Debug (hooks): Processing hook "after_add_command:network" with 1 callbacks (0.04s)
Debug (hooks): On hook "after_add_command:network": Closure in file phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 634 (0.04s)
Debug (commands): Adding command: meta in network Namespace (0.041s)
Debug (commands): Adding command: db (0.044s)
Debug (commands): Adding command: plugin (0.048s)
Debug (commands): Adding command: theme (0.05s)
Debug (commands): Adding command: mod in theme Namespace (0.051s)
Debug (commands): Adding command: scaffold (0.053s)
Debug (commands): Adding command: core (0.053s)
Debug (commands): Adding command: verify-checksums in core Namespace (0.054s)
Debug (commands): Adding command: verify-checksums in plugin Namespace (0.055s)
Debug (commands): Adding command: export (0.056s)
Debug (commands): Adding command: config (0.058s)
Debug (commands): Adding command: core (0.06s)
Debug (commands): Adding command: eval (0.061s)
Debug (commands): Adding command: eval-file (0.061s)
Debug (commands): Adding command: import (0.062s)
Debug (commands): Adding command: media (0.063s)
Debug (commands): Adding command: package (0.065s)
Debug (commands): Adding command: cron (0.066s)
Debug (commands): Adding command: event in cron Namespace (0.067s)
Debug (commands): Adding command: schedule in cron Namespace (0.067s)
Debug (commands): Adding command: embed (0.068s)
Debug (commands): Adding command: fetch in embed Namespace (0.068s)
Debug (commands): Adding command: provider in embed Namespace (0.069s)
Debug (commands): Adding command: handler in embed Namespace (0.069s)
Debug (commands): Adding command: cache in embed Namespace (0.07s)
Debug (commands): Adding command: i18n (0.07s)
Debug (commands): Adding command: make-pot in i18n Namespace (0.071s)
Debug (commands): Adding command: make-json in i18n Namespace (0.072s)
Debug (commands): Deferring command: language core (0.073s)
Debug (commands): Deferring command: language plugin (0.073s)
Debug (commands): Deferring command: language theme (0.074s)
Debug (hooks): Immediately invoking on passed hook "after_add_command:site": Closure in file phar:///usr/local/bin/wp/vendor/wp-cli/language-command/language-command.php at line 39 (0.074s)
Debug (commands): Adding command: switch-language in site Namespace (0.074s)
Debug (commands): Adding command: language (0.074s)
Debug (hooks): Processing hook "after_add_command:language" with 3 callbacks (0.074s)
Debug (hooks): On hook "after_add_command:language": Closure in file phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 634 (0.074s)
Debug (commands): Adding command: core in language Namespace (0.075s)
Debug (hooks): On hook "after_add_command:language": Closure in file phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 634 (0.075s)
Debug (commands): Adding command: plugin in language Namespace (0.076s)
Debug (hooks): On hook "after_add_command:language": Closure in file phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 634 (0.076s)
Debug (commands): Adding command: theme in language Namespace (0.076s)
Debug (commands): Adding command: maintenance-mode (0.077s)
Debug (commands): Adding command: rewrite (0.078s)
Debug (commands): Adding command: rewrite (0.078s)
Debug (commands): Adding command: cap (0.079s)
Debug (commands): Adding command: role (0.08s)
Debug (commands): Adding command: search-replace (0.082s)
Debug (commands): Adding command: server (0.082s)
Debug (commands): Adding command: shell (0.083s)
Debug (commands): Adding command: super-admin (0.083s)
Debug (commands): Adding command: widget (0.085s)
Debug (commands): Adding command: sidebar (0.085s)
Debug (bootstrap): Adding framework command: phar://wp-cli.phar/vendor/wp-cli/wp-cli/php/commands/cli.php (0.085s)
Debug (commands): Adding command: cli (0.087s)
Debug (commands): Adding command: cache in cli Namespace (0.088s)
Debug (commands): Adding command: alias in cli Namespace (0.088s)
Debug (bootstrap): Adding framework command: phar://wp-cli.phar/vendor/wp-cli/wp-cli/php/commands/help.php (0.088s)
Debug (commands): Adding command: help (0.089s)
Debug (bootstrap): No readable global config found (0.089s)
Debug (bootstrap): No project config found (0.089s)
Debug (bootstrap): argv: /usr/local/bin/wp core install --url=example --title="Example" --admin_user=admin [email protected] --skip-email --debug (0.09s)
Debug (bootstrap): ABSPATH defined: /home/circleci/wordpress/ (0.09s)
Debug (bootstrap): Set URL: example (0.09s)
Debug (bootstrap): Begin WordPress load (0.09s)
Debug (bootstrap): wp-config.php path: /home/circleci/wordpress/wp-config.php (0.09s)
circleci@142b5627c098:~/wordpress$
I've tried regenerating wp-config using wp config create
with just the bare minimum and visually inspected and it seems fine but no change.
Working within a Docker container (circleci/php:latest) and I'm struggling with wp-cli a bit. When I attempt to run wp core install
I get a silent failure with 255 exit code. I enabled --debug hoping to get some more information but unfortunately all I can see is that it stops after reading wp-config.php.
circleci@142b5627c098:~/wordpress$ wp core install --url=example --title="Example" --admin_user=admin [email protected] --skip-email --debug
Debug (bootstrap): Fallback autoloader paths: phar://wp-cli.phar/vendor/autoload.php (0.01s)
Debug (bootstrap): Loading detected autoloader: phar://wp-cli.phar/vendor/autoload.php (0.011s)
Debug (commands): Adding command: cache (0.015s)
Debug (commands): Adding command: transient (0.017s)
Debug (commands): Adding command: comment (0.019s)
Debug (commands): Adding command: meta in comment Namespace (0.02s)
Debug (commands): Adding command: menu (0.021s)
Debug (commands): Adding command: item in menu Namespace (0.022s)
Debug (commands): Adding command: location in menu Namespace (0.022s)
Debug (commands): Deferring command: network meta (0.023s)
Debug (commands): Adding command: option (0.024s)
Debug (commands): Adding command: post (0.026s)
Debug (commands): Adding command: meta in post Namespace (0.026s)
Debug (commands): Adding command: term in post Namespace (0.027s)
Debug (commands): Adding command: post-type (0.028s)
Debug (commands): Adding command: site (0.03s)
Debug (commands): Adding command: meta in site Namespace (0.031s)
Debug (commands): Adding command: option in site Namespace (0.032s)
Debug (commands): Adding command: taxonomy (0.033s)
Debug (commands): Adding command: term (0.034s)
Debug (commands): Adding command: meta in term Namespace (0.035s)
Debug (commands): Adding command: user (0.037s)
Debug (commands): Adding command: meta in user Namespace (0.038s)
Debug (commands): Adding command: session in user Namespace (0.039s)
Debug (commands): Adding command: term in user Namespace (0.04s)
Debug (commands): Adding command: network (0.04s)
Debug (hooks): Processing hook "after_add_command:network" with 1 callbacks (0.04s)
Debug (hooks): On hook "after_add_command:network": Closure in file phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 634 (0.04s)
Debug (commands): Adding command: meta in network Namespace (0.041s)
Debug (commands): Adding command: db (0.044s)
Debug (commands): Adding command: plugin (0.048s)
Debug (commands): Adding command: theme (0.05s)
Debug (commands): Adding command: mod in theme Namespace (0.051s)
Debug (commands): Adding command: scaffold (0.053s)
Debug (commands): Adding command: core (0.053s)
Debug (commands): Adding command: verify-checksums in core Namespace (0.054s)
Debug (commands): Adding command: verify-checksums in plugin Namespace (0.055s)
Debug (commands): Adding command: export (0.056s)
Debug (commands): Adding command: config (0.058s)
Debug (commands): Adding command: core (0.06s)
Debug (commands): Adding command: eval (0.061s)
Debug (commands): Adding command: eval-file (0.061s)
Debug (commands): Adding command: import (0.062s)
Debug (commands): Adding command: media (0.063s)
Debug (commands): Adding command: package (0.065s)
Debug (commands): Adding command: cron (0.066s)
Debug (commands): Adding command: event in cron Namespace (0.067s)
Debug (commands): Adding command: schedule in cron Namespace (0.067s)
Debug (commands): Adding command: embed (0.068s)
Debug (commands): Adding command: fetch in embed Namespace (0.068s)
Debug (commands): Adding command: provider in embed Namespace (0.069s)
Debug (commands): Adding command: handler in embed Namespace (0.069s)
Debug (commands): Adding command: cache in embed Namespace (0.07s)
Debug (commands): Adding command: i18n (0.07s)
Debug (commands): Adding command: make-pot in i18n Namespace (0.071s)
Debug (commands): Adding command: make-json in i18n Namespace (0.072s)
Debug (commands): Deferring command: language core (0.073s)
Debug (commands): Deferring command: language plugin (0.073s)
Debug (commands): Deferring command: language theme (0.074s)
Debug (hooks): Immediately invoking on passed hook "after_add_command:site": Closure in file phar:///usr/local/bin/wp/vendor/wp-cli/language-command/language-command.php at line 39 (0.074s)
Debug (commands): Adding command: switch-language in site Namespace (0.074s)
Debug (commands): Adding command: language (0.074s)
Debug (hooks): Processing hook "after_add_command:language" with 3 callbacks (0.074s)
Debug (hooks): On hook "after_add_command:language": Closure in file phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 634 (0.074s)
Debug (commands): Adding command: core in language Namespace (0.075s)
Debug (hooks): On hook "after_add_command:language": Closure in file phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 634 (0.075s)
Debug (commands): Adding command: plugin in language Namespace (0.076s)
Debug (hooks): On hook "after_add_command:language": Closure in file phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/class-wp-cli.php at line 634 (0.076s)
Debug (commands): Adding command: theme in language Namespace (0.076s)
Debug (commands): Adding command: maintenance-mode (0.077s)
Debug (commands): Adding command: rewrite (0.078s)
Debug (commands): Adding command: rewrite (0.078s)
Debug (commands): Adding command: cap (0.079s)
Debug (commands): Adding command: role (0.08s)
Debug (commands): Adding command: search-replace (0.082s)
Debug (commands): Adding command: server (0.082s)
Debug (commands): Adding command: shell (0.083s)
Debug (commands): Adding command: super-admin (0.083s)
Debug (commands): Adding command: widget (0.085s)
Debug (commands): Adding command: sidebar (0.085s)
Debug (bootstrap): Adding framework command: phar://wp-cli.phar/vendor/wp-cli/wp-cli/php/commands/cli.php (0.085s)
Debug (commands): Adding command: cli (0.087s)
Debug (commands): Adding command: cache in cli Namespace (0.088s)
Debug (commands): Adding command: alias in cli Namespace (0.088s)
Debug (bootstrap): Adding framework command: phar://wp-cli.phar/vendor/wp-cli/wp-cli/php/commands/help.php (0.088s)
Debug (commands): Adding command: help (0.089s)
Debug (bootstrap): No readable global config found (0.089s)
Debug (bootstrap): No project config found (0.089s)
Debug (bootstrap): argv: /usr/local/bin/wp core install --url=example --title="Example" --admin_user=admin [email protected] --skip-email --debug (0.09s)
Debug (bootstrap): ABSPATH defined: /home/circleci/wordpress/ (0.09s)
Debug (bootstrap): Set URL: example (0.09s)
Debug (bootstrap): Begin WordPress load (0.09s)
Debug (bootstrap): wp-config.php path: /home/circleci/wordpress/wp-config.php (0.09s)
circleci@142b5627c098:~/wordpress$
I've tried regenerating wp-config using wp config create
with just the bare minimum and visually inspected and it seems fine but no change.
2 Answers
Reset to default 2I was missing some php extensions that wp-cli and/or WordPress needed but there is no error output stating as much. I'm guessing it was specifically the missing mysqli extension.
I used a WP-CLI command to test the base container for missing extensions and now I have sudo docker-php-ext-install gd sockets mysqli exif
in my config.yml.
Thanks to @leymannx for linking his own repo that got me onto the right track.
Ah! Now I just saw, that you are in a CircleCI container! I heavily rely on CircleCI containers for WordPress development. And I remember I once had the same problem. It's because your host needs to be specified as 127.0.0.1
with --dbhost
like this:
$ wp config create --dbname=circle_test --dbuser=root --dbpass="" --dbhost=127.0.0.1
I also have a working sample repo live which may help you further: https://github/leymannx/wordpress-circleci-behat. Maybe you can check your .circleci/config.yml
against the one from this repo to find the culprit.
本文标签: wp cliwpcli silently fails with 255 when running wp core install
版权声明:本文标题:wp cli - wp-cli silently fails with 255 when running wp core install 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745479612a2660120.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
wp config create
command? What doeswp config list
return you? Can you accessmysql -uUSER -pPASSWORD
from the command line? – norman.lol Commented May 20, 2019 at 5:42wp config create --dbhost=127.0.0.1 --dbname=wordpress --dbuser=root --path=wordpress/
And it retunsSuccess: Generated 'wp-config.php' file.
when I check the log. But I am also testing on a VM of my own with the same container but my setup is unfortunately slightly different so my command is:wp config create --dbhost=127.0.0.1 --dbname=wordpress --dbuser=root --path=wordpress/
Local I tried with no password as well but I though it may have been causing a problem. I have no issues using the mysql client to connect. – Derek Held Commented May 20, 2019 at 13:24.circleci/config.yml
look like? – norman.lol Commented May 20, 2019 at 13:34