VScode中使用xDebug插件调试PHP脚本,无法从网页触发
大神们,
小弟在使用VScode的PHP debug插件,按照xDebug的指示配置好了php.ini 和 launch.json 文件,而且PHP 脚本可以在VScode中直接运行进行调试了。但是如果脚本是从网页上运行的(http://),那么绝大部分时候无法被触发,在Debug console中给出:connection x: read ECONNRESET的错误提示。 但极少的时候,调试能被正常触发。
我的环境是 WIN10 x64, Apacha 2.4.1, PHP 7.4.3 VC15 x64 TS, PHP Debug 插件1.13.0, xDebug 2.9.3
下面是php.ini 的配置:
[xdebug]
zend_extension = C:\php\ext\php_xdebug-2.9.3-7.4-vc15-x86_64.dll
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back=1
xdebug.remote_port = 9000
xdebug.remote_handler=dbgp
launch.json 配置:
{
"version": "0.2.0",
"configurations": [
{
"name": "xDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"name": "CLI",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}
并且在配置上述内容后,不做调试的php网页也无法运行了。
请高人指点,还需要做哪些设置?
谢谢