• Hi All,
    I have installed wp-cli. The command “wp” works but any subcommand indicates that “This does not seem to be a wordpress install”

    Running: wp –path=/opt/bitnami/apps/wordpress/htdocs info returns

    PHP Notice: Undefined index: HTTP_HOST in phar:///usr/local/bin/wp/php/WP_CLI/Runner.php(982) : eval()’d code on line 90
    PHP Notice: Undefined index: HTTP_HOST in phar:///usr/local/bin/wp/php/WP_CLI/Runner.php(982) : eval()’d code on line 91
    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:110
    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 110

    I suspect that the lightsail specific install of php and wordpress may be the issue.

    I would appreciate your help to resolve.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Are you in the root directory of your WP site when you run the wp-cli commands?

    Thread Starter jimmy987654321

    (@jimmy987654321)

    Yes I’m in /opt/bitnami/apps/wordpress/htdocs

    Thread Starter jimmy987654321

    (@jimmy987654321)

    Apologies, that’s probably not clear. When I run the command wp –info from /opt/bitnami/apps/wordpress/htdocs then I get expected results.

    When I run “wp plugin list” I get the error above.

    Thread Starter jimmy987654321

    (@jimmy987654321)

    I have tried this now on AWS lightsail as well as on the Bitnami WordPress AMI provided in the market place with the same results.

    I can comment out the “require_once(ABSPATH , ‘wp-settings.php’); line and see the list of plugins. However it still shows the errors:

    PHP Notice: Undefined index: HTTP_HOST in phar:///usr/local/bin/wp/php/WP_CLI/Runner.php(982) : eval()’d code on line 90
    PHP Notice: Undefined index: HTTP_HOST in phar:///usr/local/bin/wp/php/WP_CLI/Runner.php(982) : eval()’d code on line 91

    so it would seem to be related to the regex of the abspath statement but after that I’m lost

    Thread Starter jimmy987654321

    (@jimmy987654321)

    Does anyone know where in wp-cli.phar the regex statement is that strips the abspath out of wp-config.php

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wp-config and wp-cli issue’ is closed to new replies.