通过 SSH 隧道进行远程调试:接收 "There was a problem sending x bytes on socket y: Broken pipe"

Remote debugging via SSH tunnel: receiving "There was a problem sending x bytes on socket y: Broken pipe"

想法是设置"Remote debugging via a SSH tunnel"。更详细地说:我们在 Windows PC 本地 运行 PhpStorm。 运行 远程 Centos 服务器上的 Xdebug。我们使用 SSH 隧道选项通过 Putty 进行连接。

我们遵循以下指南: https://www.jetbrains.com/help/phpstorm/remote-debugging-via-ssh-tunnel.html

问题是,如果我们在远程服务器上使用 XDEBUG_CONFIG=idekey=phpstorm php myscriptcommand.php 启动 CLI 调试,我们会在 ssh 屏幕中收到如下错误 xxxx.xx: There was a problem sending 318 bytes on socket 4: Broken pipe

Netstat 向我们展示

prompt on server$ netstat -a -n | grep 9000
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN
tcp        0      1 remote_server_ip:47160     66.249.79.197:9000      SYN_SENT

问题:如何防止管道破裂或这里出了什么问题?

通过将默认端口更改为空闲端口解决了此问题,在本例中为 9001。phpfpm 运行 在端口 9000 上。

xdebug(putty/ssh 隧道和 phpstorm 中的端口都需要更新为 port:9001(或另一个空闲端口)

我也遇到了同样的问题,发现xdebug开启了默认的远程调试

而且我的Phpstorm也开着,xdebug的DBGP协议在接收数据的过程中被阻塞了

xdebug.remote_autostart=1

我将过程记录到我的博客中:https://tkstorm.com/posts-list/programming/php/xdebug-timeout-question/