ssh - 通过 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
问题:我们怎样才能防止发生破裂的管道或这里出了什么问题?
解决方案
通过将默认端口更改为空闲端口(在本例中为 9001)解决了此问题。php fpm 在端口 9000 上运行。
xdebug 的端口(putty/ssh 隧道和 phpstorm 中的端口都需要更新为 port:9001 (或另一个空闲端口)
推荐阅读
- firebase - Google Firebase 托管未配置我的证书
- kubernetes - Kubectl : 没有找到资源,即使在命名空间中运行 pod 也很难
- android - android如何在YoutubeBaseActivity上添加带有片段的viewpager?
- mysql - TypeError:无法访问字符串上类型字符串的偏移量
- c# - 新部署的 Azure Web 应用返回 404 错误代码
- flutter - 如何在 showModalBottomSheet 中获取正确的上下文?
- google-cloud-firestore - Firebase Firestore 安全规则“request.auth.ui”不等于“KullaniciId”
- sql-server - SQL Server Express 无法设置登录密码
- sql - 如何在 SQL 脚本中传递令牌?
- javascript - 在反应中提交带有formData的PDF文件