VScode中使用xDebug插件调试PHP脚本,无法从网页触发

qpmaggie 2020-03-20 08:54:28
大神们,

小弟在使用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网页也无法运行了。

请高人指点,还需要做哪些设置?

谢谢
...全文
325 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

21,890

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧