【发布时间】:2021-03-18 21:02:20
【问题描述】:
我在尝试在 VSCode 中调试一些 Laravel 代码时遇到此错误:
Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9000 (through xdebug.client_host/xdebug.client_port) :-(
我尝试了不同的端口,但没有改变!
php.ini 配置:
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000
launch.json 配置:
{
"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
},
{
"name": "Listen for XDebug on Homestead",
"type": "php",
"request": "launch",
"pathMappings": {
"/home/vagrant/Code/tighten-app-homestead": "/Users/jose/Code/tighten-app-homestead"
},
"port": 9000
}
]
}
另外,我使用的是 Windows,而不是 Linux!
【问题讨论】:
-
不是错误,只是提示。显然你的 IDE 没有监听...将“start_with_request”更改为“no”,或者开始监听调试请求...