VSCode PHP debug ext无法连接到DBGp代理服务器

问题描述 投票:0回答:1
  • PHP版本:v8.1.18
  • Xdebug版本:3.2.0
  • 网络服务器:远程192.168.10.10上的Homestead
  • DBGp 代理服务器在本地 Windows 10 上运行:
./dbgpProxy.exe -i 127.0.0.1:9001 -s 0.0.0.0:9003
  • xdebug.ini
xdebug.mode = debug
xdebug.client_port = 9003
xdebug.client_host = 192.168.10.1
xdebug.start_with_request = trigger
xdebug.trigger_value = ''
  • PHP 调试 launch.json
{
    "name": "DBGp Proxy",
    "type": "php",
    "request": "launch",
    "pathMappings": {
        "/home/vagrant/laravel10": "D:\\workspace\\laravel10"
    },
    "proxy": {
        "enable": true,
        "host": "127.0.0.1",
        "port": 9001,
        "key": "vsc",
        "allowMultipleSessions": false
    }
}
  • DBGp代理服务器日志:
06:46:36.326 [info] [server] Start new server connection from 192.168.10.10:36512
06:46:36.327 [info] [proxy-client] [vsc] Could not find IDE connection for IDE Key 'vsc'
06:46:36.331 [warn] [server] Handler response error: Error reading response: Error reading length: EOF
06:46:36.332 [info] [server] Closing server connection from 192.168.10.10:36512
  • 使用 PhpStorm 一切正常:
07:03:13.986 [info] [server] Start new server connection from 192.168.10.10:37788
07:03:13.987 [info] [proxy-client] [PHPSTORM] Found connection for IDE Key 'PHPSTORM': 127.0.0.1:9000
07:03:13.991 [info] [proxy-client] [PHPSTORM] Connecting to 127.0.0.1:9000
07:03:13.994 [info] [proxy-client] [PHPSTORM] IDE connected
07:03:13.996 [info] [proxy-client] [PHPSTORM] Init forwarded, start pipe

我在 VSCode 中找不到类似

Register IDE
的东西。如何将 VSCode IDE 客户端连接到 DBGp 代理服务器?

vscode-extensions xdebug
1个回答
0
投票

单击“Listen for Xdebug”旁边的绿色箭头后,它就会注册。

类似于在 PhpStorm 中单击“开始侦听 PHP 调试连接”。

正好,我昨天录了一个视频来解释一下:https://youtu.be/_3RkGZK-UC8

我会跟进文章版本。

© www.soinside.com 2019 - 2024. All rights reserved.