php icon indicating copy to clipboard operation
php copied to clipboard

PHP_TAG=8.3-dev doesn't work with Xdebug

Open rahunak opened this issue 1 year ago • 2 comments

Fresh installed site with PHP_TAG=8.2-dev-4.43.6 from https://github.com/wodby/docker4drupal
in php container have output: [email protected]:/var/www/html $ php -v
PHP 8.2.5 (cli) (built: Apr 14 2023 17:52:42) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.5, Copyright (c) Zend Technologies
with Zend OPcache v8.2.5, Copyright (c), by Zend Technologies
with Xdebug v3.2.0, Copyright (c) 2002-2022, by Derick Rethans

But when I switch php to PHP_TAG=8.3-dev-4.60.2 in php container have output: [email protected]:/var/www/html $ php -v
PHP 8.3.9 (cli) (built: Jul 6 2024 01:11:01) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.9, Copyright (c) Zend Technologies
with Zend OPcache v8.3.9, Copyright (c), by Zend Technologies

In the new version no Xdebug, it's a problem. Any help appreciated.

rahunak avatar Jul 24 '24 14:07 rahunak

This is probably due to the change introduced in 4.47.0, we got rid of the confusingPHP_XDEBUG env var (https://github.com/wodby/php/issues/176).

So now by default xdebug disabled via the default value of PHP_EXTENSIONS_DISABLE='xdebug,xhprof,spx', if you need to enable xdebug you should override it (e.g. PHP_EXTENSIONS_DISABLE='xhprof,spx'). But maybe we should enable all extensions by default in the -dev variants 🤔

csandanov avatar Jul 24 '24 15:07 csandanov

Ran into a similar issue while testing things locally on a Drupal 10 site using wodby/php where Xdebug would not stop on breakpoints. We found this to not be tied to a specific PHP version but rather, as @csandanov said, to the wodby/php image version.

The above suggested resolution of swapping out PHP_XDEBUG: 1 for PHP_EXTENSIONS_DISABLE: 'xhprof,spx' worked for us.

+1 for the suggestion to enable all extensions by default for dev variants.

frank-holub avatar Sep 12 '24 17:09 frank-holub