首页 > 解决方案 > 通过 SSH 隧道进行远程调试:接收“在套接字 y 上发送 x 字节时出现问题:管道损坏”

问题描述

这个想法是设置“通过 SSH 隧道进行远程调试”。更详细地说:我们在本地的 Windows PC 上运行 PhpStorm。在远程 Centos 服务器上运行 Xdebug。我们使用 SSH 隧道选项通过 Putty 进行连接。

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

问题是,如果我们在远程服务器上使用 CLI 调试XDEBUG_CONFIG=idekey=phpstorm php myscriptcommand.php,我们会在 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

问题:我们怎样才能防止发生破裂的管道或这里出了什么问题?

标签: sshphpstormssh-tunnel

解决方案


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

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


推荐阅读