Would it be possible to be able to override path to PHP binary inside this handler, please? Maybe using some ENV variable?
I am using wrapper for PHP 8.5 under WSL1, so PHP_BINARY constant does not return wrapper, but original binary. Therefore I get this error when running composer under PHP 8.5 with Xdebug enabled:
PHP Warning: proc_open(): posix_spawn() failed: Exec format error in phar:///usr/local/bin/composer/vendor/composer/xdebug-handler/src/XdebugHandler.php on line 300
PHP Stack trace:
PHP 1. {main}() /usr/local/bin/composer:0
PHP 2. require() /usr/local/bin/composer:29
PHP 3. Composer\XdebugHandler\XdebugHandler->check() phar:///usr/local/bin/composer/bin/composer:43
PHP 4. Composer\XdebugHandler\XdebugHandler->restart($command = [0 => '/usr/bin/php8.5-bin', 1 => '-n', 2 => '-c', 3 => '/tmp/fh3d7t9hgapgdGR3Iik', 4 => '/usr/local/bin/composer']) phar:///usr/local/bin/composer/vendor/composer/xdebug-handler/src/XdebugHandler.php:149
PHP 5. Composer\XdebugHandler\XdebugHandler->doRestart($command = [0 => '/usr/bin/php8.5-bin', 1 => '-n', 2 => '-c', 3 => '/tmp/fh3d7t9hgapgdGR3Iik', 4 => '/usr/local/bin/composer']) phar:///usr/local/bin/composer/vendor/composer/xdebug-handler/src/XdebugHandler.php:274
PHP 6. proc_open($command = [0 => '/usr/bin/php8.5-bin', 1 => '-n', 2 => '-c', 3 => '/tmp/fh3d7t9hgapgdGR3Iik', 4 => '/usr/local/bin/composer'], $descriptor_spec = [], $pipes = NULL) phar:///usr/local/bin/composer/vendor/composer/xdebug-handler/src/XdebugHandler.php:300
It would be nice if path to PHP binary could be specified manually here.
Here is relevant part:
https://github.com/composer/xdebug-handler/blob/main/src/XdebugHandler.php#L438
Instead of:
Maybe something like:
$php = [getenv('PHP_BINARY') ?: PHP_BINARY];
Or some other solution...?
Thanks!
Would it be possible to be able to override path to PHP binary inside this handler, please? Maybe using some ENV variable?
I am using wrapper for PHP 8.5 under WSL1, so PHP_BINARY constant does not return wrapper, but original binary. Therefore I get this error when running composer under PHP 8.5 with Xdebug enabled:
It would be nice if path to PHP binary could be specified manually here.
Here is relevant part:
https://github.com/composer/xdebug-handler/blob/main/src/XdebugHandler.php#L438
Instead of:
Maybe something like:
Or some other solution...?
Thanks!