WP-CLI PHP Deprecated warnings persist on shebang-launched phar binaries, fix released
Developers found that setting WP_CLI_PHP_ARGS to suppress PHP 8.2 Deprecated warnings failed on Xserver because WP-CLI is deployed there as a shebang-launched phar binary, preventing the environment variable from ever reaching PHP's startup options. An agency first reported the issue when plugin list retrieval across multiple sites produced hundreds of Deprecated messages despite the standard configuration being in place. Tracing the execution path confirmed that when PHP is invoked via a shebang line, WP-CLI has no opportunity to inject the -d error_reporting flag into PHP's invocation. Version 1.6.8 of the tool introduces a function that inspects the WP-CLI path and, if the leading binary is a php variant, inserts the suppression flag directly after the binary name. A second helper was also added to extract only valid JSON from command output, guarding against residual notices or warnings that may still appear in stdout.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in