N
N
Ninja Mate2017-04-27 03:24:12
Command line
Ninja Mate, 2017-04-27 03:24:12

How to fix errors when launching WP-CLI?

installed wp-cli on aws now trying to run command

sudo wp media regenerate --yes --debug --allow-root

which leads to this error.
[email protected]****:/opt/bitnami/apps/wordpress/htdocs$ sudo wp media regenerate --yes --debug --allow-root
Debug (bootstrap): No readable global config found (0.008s)
Debug (bootstrap): No project config found (0.009s)
Debug (bootstrap): No package autoload found to load. (0.045s)
Debug (bootstrap): ABSPATH defined: /opt/bitnami/apps/wordpress/htdocs/ (0.045s)
Debug (bootstrap): Begin WordPress load (0.045s)
Debug (bootstrap): wp-config.php path : /opt/bitnami/apps/wordpress/htdocs/wp-config.php (0.045s)
PHP Notice: Undefined index: HTTP_HOST in phar:///usr/local/bin/wp/php/WP_CLI/Runner.php( 982) : eval()'d code on line 93
PHP Notice: Undefined index: HTTP_HOST in phar:///usr/local/bin/wp/php/WP_CLI/Runner.php(982) : eval()'d code on line 94
PHP Fatal error: Uncaught Error: Call to undefined function add_filter() in phar:///usr/local/bin/wp/php/WP_CLI/Runner.php(982) : eval()'d code:119
Stack trace:
#0 phar:///usr/ local/bin/wp/php/WP_CLI/Runner.php(982): eval()
#1 phar:///usr/local/bin/wp/php/WP_CLI/Runner.php(945): WP_CLI\Runner- >load_wordpress()
#2 phar:///usr/local/bin/wp/php/wp-cli.php(21): WP_CLI\Runner->start()
#3 phar:///usr/local/bin /wp/php/boot-phar.php(5): include('phar:///usr/loc...')
#4 /usr/local/bin/wp(4): include('phar:/ //usr/loc...')
#5 {main}
thrown in phar:///usr/local/bin/wp/php/WP_CLI/Runner.php(982) : eval()'d code on line 119
[email protected]:/opt/ bitnami/apps/wordpress/htdocs$

How to fix this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question