VSCode中的Xdebug超时连接 [英] Time-out connecting Xdebug in VSCode

查看:696
本文介绍了VSCode中的Xdebug超时连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试调试VSCode中的一些Laravel代码时遇到此错误:

I'm getting this error while I'm trying to debug some Laravel code in VSCode:

Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9000 (through xdebug.client_host/xdebug.client_port) :-(

我尝试了其他端口,但没有任何变化!

I have tried different ports but no change !

php.ini配置:

php.ini configuration :

xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000

launch.json配置:

launch.json configuration :

{
    "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上!

Also, I'm on Windows, not Linux!

推荐答案

在我使用创建者Derick的答案修复了WordPress中的调试设置后,我也在寻找解决方案.

I was also searching for solutions after I fixed the debugging setting in WordPress using the answers by creator Derick.

然后,我为Laravel进行了测试,并遇到了您所遇到的确切错误.然后,仔细查看设置,意识到我们需要使用 port:9003 而不是 9000

Then I tested for Laravel and was facing the exact error you were facing. Then, looking closely at the setting, realized that we need to use port: 9003 instead of 9000

检出: https://xdebug.org/docs/upgrade_guide#Step-Debugging

解决方案:

更改端口

端口":9000

收件人

端口":9003

此外,您还可以在 Xdebug显示方法不存在的情况下阅读我的问题和答案.消息

这篇关于VSCode中的Xdebug超时连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆