Skip to content

wp --info prints WP_CLI_PHP variable instead of the used interpreter #5615

@castilma

Description

@castilma

Bug Report

Describe the current, buggy behavior

I installed the phar version and tried using WP_CLI_PHP. The documentation says this is ignored, but wp --info still prints it's value, instead of the real binary it's using. This is misleading.

Describe how other contributors can replicate this bug

Install the phar version of wp.

$ export WP_CLI_PHP=fooobar WP_CLI_PHP_ARGS="-c /tmp/baz.ini"; touch /tmp/baz.ini; /usr/local/bin/wp --info
OS:	Darwin 20.6.0 Darwin Kernel Version 20.6.0: Wed Nov 10 22:23:07 PST 2021; root:xnu-7195.141.14~1/RELEASE_X86_64 x86_64
Shell:	/bin/bash
PHP binary:	fooobar
PHP version:	8.1.2
php.ini used:	/Users/.../homebrew/etc/php/8.1/php.ini
MySQL binary:	/Users/...
MySQL version:	mysql  Ver 8.0.28 for macos11.6 on x86_64 (Homebrew)
SQL modes:	
WP-CLI root dir:	phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:	phar://wp-cli.phar/vendor
WP_CLI phar path:	/Users/...
WP-CLI packages dir:	
WP-CLI global config:	
WP-CLI project config:	
WP-CLI version:	2.6.0

Note, that it correctly ignores the value of WP_CLI_PHP_ARGS, as stated in the documentation.

Describe what you expect as the correct outcome
The PHP binary: should contain the absolute path to the actual interpreter running it.

Let us know what environment you are running this on

OS:	Darwin 20.6.0 Darwin Kernel Version 20.6.0: Wed Nov 10 22:23:07 PST 2021; root:xnu-7195.141.14~1/RELEASE_X86_64 x86_64
Shell:	/bin/bash
PHP binary:	fooobar
PHP version:	8.1.2
php.ini used:	/Users/.../homebrew/etc/php/8.1/php.ini
MySQL binary:	/Users/...
MySQL version:	mysql  Ver 8.0.28 for macos11.6 on x86_64 (Homebrew)
SQL modes:	
WP-CLI root dir:	phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:	phar://wp-cli.phar/vendor
WP_CLI phar path:	/Users/...
WP-CLI packages dir:	
WP-CLI global config:	
WP-CLI project config:	
WP-CLI version:	2.6.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions