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



这个想法是设置"通过SSH隧道进行远程调试"。更详细地说:我们在本地的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.php fpm 在端口 9000 上运行。

xdebug 的端口(putty/ssh 隧道和 phpstorm 中的端口都需要更新到 port:9001(或其他自由端口(<</p>

div class="ans>

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

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

xdebug.remote_autostart=1

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

相关内容

最新更新