php-fpm:mods available/xdebug.ini中的设置无效



我正试图通过编辑可用的mods/xdebug.ini来应用自定义xdebug设置,但当我重新启动php-fpm时,只应用了默认设置。错误日志中没有可见的相关错误。

没有应用自定义设置的原因是什么?

zend_extension=xdebug.so
xdebug.remote_enable=on
xdebug.default_enable=on
xdebug.remote_autostart=off
#The default port 9000 doesn’t work as some other service (don’t remember which one) is using it as well
xdebug.remote_port=10000
#phpstorm's xdebug validate tool suggests:
#xdebug.remote_host=172.27.0.1
#but it's not working
#on mac you have to use this for docker
#xdebug.remote_host=docker.for.mac.localhost
#or (is the more recent one):
xdebug.remote_host = host.docker.internal
#more info:
#https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000229624-Setting-up-xDebug-with-PHPUnit-using-Docker-for-Mac-and-PHPStorm
#https://devilbox-test.readthedocs.io/en/stable/tutorials/enable-xdebug.html
#https://docs.docker.com/docker-for-mac/networking/#use-cases-and-workarounds

xdebug.profiler_enable_trigger=1
xdebug.profiler_output_name=xdebug-profile-cachegrind.out-%H-%R
xdebug.var_display_max_children = 128
xdebug.var_display_max_data = 512
xdebug.var_display_max_depth = 3
xdebug.idekey=PHPSTORM

当试图找出哪些模块是通过php-cli命令启用的"php-m";我得到了一个启用模块的列表,但列表上方也有一条错误消息:

PHP:  syntax error, unexpected '(' in /etc/php/7.4/cli/conf.d/20-xdebug.ini on line 5

它指出,#字符并没有被解释为注释的开头。所以,经过短暂的谷歌搜索,我发现必须使用分号来屏蔽ini文件中的注释:

zend_extension=xdebug.so
xdebug.remote_enable=on
xdebug.default_enable=on
xdebug.remote_autostart=off
;The default port 9000 doesn’t work as some other service  (don’t remember which one)  is using it as well
xdebug.remote_port=10000
;phpstorm's xdebug validate tool suggests:
;xdebug.remote_host=172.27.0.1
;but it's not working
;on mac you have to use this for docker
;xdebug.remote_host=docker.for.mac.localhost
;or  (is the more recent one):
xdebug.remote_host = host.docker.internal
;more info:
;https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000229624-Setting-up-xDebug-with-PHPUnit-using-Docker-for-Mac-and-PHPStorm
;https://devilbox-test.readthedocs.io/en/stable/tutorials/enable-xdebug.html
;https://docs.docker.com/docker-for-mac/networking/#use-cases-and-workarounds

xdebug.profiler_enable_trigger=1
xdebug.profiler_output_name=xdebug-profile-cachegrind.out-%H-%R
xdebug.var_display_max_children = 128
xdebug.var_display_max_data = 512
xdebug.var_display_max_depth = 3
xdebug.idekey=PHPSTORM

最新更新