View Issue Details

IDProjectCategoryView StatusLast Update
0002193XdebugUncategorizedpublic2023-08-08 10:02
Reporterkarabanov Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionnot fixable 
Product Version3.2.1 
Summary0002193: In php 8.x the configuration specified via php_admin_value does not apply for XDebug
Description

If you define directives directly in the /etc/php/8.x/fpm/conf.d/20-xdebug.ini module config, the directives are applied and XDebug works correctly, but if you define directives in the php-fpm pool config using php_admin_value, they do not work, although phpinfo() and xdebug_info() print correct values

For example:
It works correctly
/etc/php/8.x/fpm/conf.d/20-xdebug.ini
zend_extension=xdebug.so
xdebug.mode=debug,profile,trace,develop,coverage,gcstats
xdebug.start_with_request=trigger
xdebug.trigger_value=PHPSTORM
xdebug.client_host=127.0.0.1
xdebug.client_port=9001
xdebug.log=/home/user/php/logs/php8.x-fpm.log
xdebug.log_level=10
xdebug.output_dir=/home/user/profiles
xdebug.profiler_output_name=cachegrind.%H.%u

It doesn't work right
/etc/php/8.x/fpm/pool.d/www.conf
... skipped ...
php_admin_value[xdebug.mode]=debug,profile,trace,develop
php_admin_value[xdebug.start_with_request]=trigger
php_admin_value[xdebug.client_host]=127.0.0.1
php_admin_value[xdebug.client_port]=9001
php_admin_value[xdebug.trigger_value]=PHPSTORM
xdebug.log=/home/user/php/logs/php8.x-fpm.log
xdebug.log_level=10
php_admin_value[xdebug.output_dir]=/home/user/profiles
php_admin_value[xdebug.profiler_output_name]=cachegrind.%H.%u

PS
8.x means any version of PHP starting from 8.0 or higher, in php 7.x, the bug does not appear and configuration using php_admin_value works correctly

Steps To Reproduce

Add this directives to PHP-FPM pool config
/etc/php/8.x/fpm/pool.d/www.conf
... skipped ...
php_admin_value[xdebug.mode]=debug,profile,trace,develop
php_admin_value[xdebug.start_with_request]=trigger
php_admin_value[xdebug.client_host]=127.0.0.1
php_admin_value[xdebug.client_port]=9001
php_admin_value[xdebug.trigger_value]=PHPSTORM
xdebug.log=/home/user/php/logs/php8.x-fpm.log
xdebug.log_level=10
php_admin_value[xdebug.output_dir]=/home/user/profiles
php_admin_value[xdebug.profiler_output_name]=cachegrind.%H.%u

Then correct values will be displayed on the page with phpinfo() or xdebug_info(), but XDebug will not actually work, if you set these directives directly in the module config /etc/php/8.x/fpm/conf.d/20-xdebug.ini, then xdebug will work

Additional Information

All PHP versions starting from 8.0 are affected

Tagsfpm, php8.0, php8.1, php8.2, xdebug
Operating SystemGNU/Linux
PHP Version8.0.20-8.0.29

Activities

derick

2023-08-08 09:40

administrator   ~0006629

Hi,

This is currently a limitation of the way how PHP-FPM and Xdebug interoperate. Xdebug needs to know when it starts whether it can enable all features, and has to do this in its "module+start". PHP-FPM allows for the changing of INI settings after this module start (through the php_admin_value setting), as well as in a few other scenarios, but that is after "module+start", and hence these changes can not be picked up by Xdebug.

cheers,
Derick

karabanov

2023-08-08 10:02

reporter   ~0006630

I understand. Thank you.

Issue History

Date Modified Username Field Change
2023-08-08 07:10 karabanov New Issue
2023-08-08 07:10 karabanov Tag Attached: fpm
2023-08-08 07:10 karabanov Tag Attached: php8.0
2023-08-08 07:10 karabanov Tag Attached: php8.1
2023-08-08 07:10 karabanov Tag Attached: php8.2
2023-08-08 07:10 karabanov Tag Attached: xdebug
2023-08-08 09:40 derick Assigned To => derick
2023-08-08 09:40 derick Status new => resolved
2023-08-08 09:40 derick Resolution open => not fixable
2023-08-08 09:40 derick Note Added: 0006629
2023-08-08 10:02 karabanov Note Added: 0006630