Xdebug 突然无法在 Eclipse Neon 上正常工作 PHP Ubuntu 16

Xdebug suddenly not properly working on Eclipse Neon PHP Ubuntu 16

昨天还好好的,今天就安装了docker,应该没有什么关系。

情况是我可以开始调试,但是当我点击任何 "Step"(F5、F6、F7、F8)按钮时,它会说 "PHP Applications (Waiting...)",就好像它正在执行代码一样, 但它永远不会结束。

如果我禁用 "Break at First Line" 它甚至会转到断点,我可以计算断点之前的任何变量,但它不会继续。

我试过创建新项目、重新安装 xdebug 和 php、切换端口、卸载 docker 以防万一、更改 php.ini 中的 xdebug 参数。

问题是调试器可以工作,但只能到第一个断点。

php.ini:

zend_extension=/usr/lib/php/20151012/xdebug.so
xdebug.profiler_output_dir="/tmp/xdebug/"
xdebug.profiler_enable=off
xdebug.profiler_enable_trigger = off
xdebug.remote_enable=on
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.idekey=ECLIPSE_DBGP
xdebug.remote_connect_back=1
xdebug.show_local_vars=0
xdebug.max_nesting_level=400

我为测试添加的一些变量,没有成功。

php信息()

在为 php7 重新安装 xdebug 后,我终于有时间玩弄配置了,在 /etc/php/7.0/cli/conf.d/20-xdebug.ini 中尝试了不同的规则,我在 github 项目问题线程中读到:

I solved by remove all Watch Variables.

我想,"it cannot be that",但给了它一个机会,它做到了。也许使用 .ini 文件有所帮助,但最终使它起作用的是删除 eclipse debug window.

中的所有表达式

这里是 git issue 线程(该项目是 PHP Debug Adapter for Visual Studio 与我的环境无关):https://github.com/felixfbecker/vscode-php-debug/issues/205

无论如何,这是适合我的 20-xdebug.ini 配置:

zend_extension="/usr/lib/php/20160303/xdebug.so"
xdebug.remote_autostart=on
xdebug.remote_enable = On
xdebug.remote_port = 9000
xdebug.remote_host = 127.0.0.1
xdebug.show_error_trace = 1
xdebug.remote_handler="dbgp"