我在 Windows 10 Pro 64 位上使用 Wamp。首先,基于 PHP XDebug 的调试在 Visual Studio Code 中的普通 Core PHP 应用程序上运行良好,但是当我开始调试基于 PhalconPhp (MVC) 的应用程序时,它在第一个断点处停止并且不继续,无论我尝试什么 - 继续 (F5) , Step Over (F10) 等。没有任何键或选项起作用。
我已经检查了所有类似的问题和解决方案 - 尝试将端口从默认 9000 更改为 9001 inphp.ini和launch.json,添加了各种帖子中建议的所有额外配置,尽管我没有进行远程调试。尝试设置单个和多个断点,并尝试将它们保留在代码开头、中间或结尾的不同行上。
配置文件
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back=1
xdebug.profiler_enable = On
xdebug.profiler_enable_trigger = On
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="R:/Temp"
xdebug.show_local_vars=1
xdebug.remote_port = 9000
xdebug.remote_log=R:\Temp\xdebug.log
启动文件
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}
没有错误消息。调试器不会移动一英寸并停留在第一个断点处。我只能在调试器中重新启动执行,其他操作(Step In、Step Over、Continue...)都不起作用。我也有,xdebug.log但没有看到任何有用的东西。
更新:调试适用于所有 Php 程序,包括 Phalcon with VSCode 1.36.1、XDebug 2.6.1、Php 7.2.14 on Windows 10。我认为 VSCode 和 XDebugger 对于较新版本有一些不兼容问题,但不确定。