Skip to content

Undefined array key warning in WP CLI #884

@fk-hm

Description

@fk-hm

Steps to reproduce

  1. Go to the Altis Dashboard.
  2. Open a CLI session
  3. See this warning at the top of the console:
Warning: Undefined array key "HTTP_HOST" in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1309) : eval()'d code on line 45
Warning: Undefined array key "HTTP_HOST" in /usr/src/app/wordpress/wp-includes/ms-settings.php on line 57

Describe what you expected to see

Silence this warning.

I assume we need to set the HTTP_HOST key when in a CLI context. I remember we maybe did this on various HM platform sites, but not sure.

Either way having this warning repeatedly during CLI operations looks poor and it's annoying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugExisting functionality isn't behaving as expected

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions