php-fpm: mods-available/xdebug.ini 中的设置无效
php-fpm: settings in mods-available/xdebug.ini have no effect
我正在尝试通过编辑 mods-available/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
我正在尝试通过编辑 mods-available/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