问题
Local:
- OS: MacOS
- IDE: PhpStorm
- Debug Port: 10000
- DBGp Proxy Host: 127.0.0.1
- DBGp Proxy Port: 10000
Remote server:
- OS: Ubuntu
- Run project via docker and expose 10000 port
Docker container:
- XDEBUG_CONFIG: "default_enable=1 remote_host=172.30.0.1 remote_enable=1 profiler_enable_trigger=0 remote_port=10000"
- I enable "Listen debug connections" in PhpStorm
- Run in terminal: ssh -R 10000:127.0.0.1:10000 root@remote-server
- Add breakpoints
- Run site page
Xdebug not working:(
Xdebug log:
Log opened at 2018-11-27 09:05:03
I: Connecting to configured address/port: 172.30.0.1:10000.
W: Creating socket for '172.30.0.1:10000', poll success, but error: Operation now in progress (29).
E: Could not connect to client. :-(
Log closed at 2018-11-27 09:05:03
I want connect to remote server for debbuging. I am not interested create port forwarding into docker container.
What am I doing wrong?
Screenshots:
回答1:
I tried to use xdebug with ssh tunnel port forwarding from remote docker-hosted server to local machine, but have no success.
But it works using ngrok. You should:
- install
ngrok
on your local development machine; - run
ngrok tcp 9000
; - set
xdebug.remote_port
andxdebug.remote_host
according tongrok
's info.
If somehow known how to do the same by ssh tunneling, please share it.
9000 - its xdebug client's port, 9000 - default value in PHP Storm, for this topic should be 10000.
来源:https://stackoverflow.com/questions/53496300/xdebug-php-7-1-phpstorm-remote-server-with-docker-how