New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WP_CLI_PHP ignored even when installing from deb not phar #5886
Comments
Thanks for the report, @sshankar-rks. I'm not an expert in the debian build but, AFAIK, it's just bundling the Phar file: I don't think there have been any substantial changes between 2.5.0 and 2.9.0: Can you re-test with the 2.5.0 binary? |
I used the 2.5.0 binary for a couple of years now and wp cli info now shows changed locations for both executable and ini file. Here is the output from the older version: I think the issue is that there is no supported way to change the PHP version in the current and future versions of WP-CLI. |
@danielbachhuber @sshankar-rks IMHO #5672 can be a root cause of this issue. |
@wojsmol So, stated another way:
Are these three statements correct? If they are, I think we can update the deb file to support |
For a complete fix, WP_CLI_PHP_ARGS also needs to be supported in the deb file. |
Bug Report
--- ✅ If you are in the correct location now... --->
Describe the current, buggy behavior
wp-cli installed from here
Ubuntu 22.04
PHP is PHP-FPM 8.1 (/usr/sbin/php-fpm8.1)
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
WP_CLI_PHP="/usr/sbin/php-fpm8.1"
wp cli info shows the PHP used is php from /usr/bin, not WP_CLI_PHP as expected
Documentation says:
"WP_CLI_PHP – PHP binary path to use when overriding the system default (only works for non-Phar installation)."
Used to work with 2.5.0 deb file
Workaround
I tried this workaround.
But since /usr/local/wp is actually a script, not a php file, that workaround fails.
What I did:
Created a symbolic link from /usr/sbin/php-fpm8.1 to /usr/sbin/php
Then changed system path
PATH="/usr/sbin:$PATH"
That isn't a change I want to do. That changes the entire system's PHP version .
(Paste the output of "wp cli info" into this box)
Expected behavior
The WP_CLI_PHP variable (and it's sibling, WP_CLI_PHP_ARGS) should both work whether using phar install or not.
The text was updated successfully, but these errors were encountered: