2

The idea is to setup "Remote debugging via a SSH tunnel". In more detail: we run PhpStorm on my Windows PC locally. Run Xdebug on a remote Centos server. We connect via Putty using the SSH tunnel option.

We are following the below guide: https://www.jetbrains.com/help/phpstorm/remote-debugging-via-ssh-tunnel.html

The problem is that if we start CLI debug using XDEBUG_CONFIG=idekey=phpstorm php myscriptcommand.php on the remote server we receive the error like below in the ssh screen xxxx.xx: There was a problem sending 318 bytes on socket 4: Broken pipe

Netstat shows us

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

Question: How can we prevent the broken pipe from occurring or what is going wrong here?

2
  • Not an SSH expert so could be completely wrong here .. but try using different port (e.g. 9001) for all Xdebug communications in case it conflicts with php-fpm that you may have installed there (as it uses 9000 by default).
    – LazyOne
    Apr 25, 2019 at 8:40
  • This was it and I'll pass it as an answer
    – snh_nl
    Apr 26, 2019 at 13:05

2 Answers 2

5

This problem was solved by changing the default port to a free port, in this case 9001. php fpm was running on port 9000.

Both the port for xdebug (the putty/ssh tunnel and in phpstorm need to be updated to port:9001 (or another free port)

1

I also encountered the same problem, and found that xdebug had started the default remote debugging.

And my Phpstorm was also on, xdebug's DBGP protocol was blocked in the process of data reception

xdebug.remote_autostart=1

I document the process to my Blog: https://tkstorm.com/posts-list/programming/php/xdebug-timeout-question/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.