How to rebug remotely using xdebug + docker with PhpStorm
Hello everyone,
I managed to use xdebug with a docker stack running on my own computer : https://github.com/programgames/oro-docker-xdebug-stack
to debug web page using chrome and xdebug helper extension. Nothing really special except the fact that
xdebug.remote_host is the ip of the host on linux and docker.for.mac.localhost on macos
I actually use this config :
error_reporting = E_ALL
display_startup_errors = On
display_errors = On
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9001
xdebug.remote_autostart=1
xdebug.remote_connect_back=0
xdebug.idekey=PHPSTORM
xdebug.remote_host=docker.for.mac.localhost
But now, i need to run this stack remotely on server and still debug from my computer ( MacOs ) .
I read many tutorial about how to debug remotly but no one was enough good to explain how to configure it with Docker.
Well, my questions are :
To debug remotely what should be the xdebug.remote_host. value ? my private/public ip ? my server private/ip ?
Do I need an ssh port fordwarding ?
Do i need to setup a dbgp proxy on server and in PhpStorm config ?
If yes , what is the config ? port / ip ?
What should be xdebug port in this case ?
请先登录再写评论。
Hi there,
If it's a Docker on remote server then yes, you would need a reverse SSH tunnel (to secure your connection/by pass NAT/router issues etc).
The overall idea is:
Check this SO question, it should give you some ideas: https://stackoverflow.com/q/62580411/783119
For Xdebug:
Sadly I can give you only this general info and not "copy-paste this to have it working" instructions.
Hello Julien I have the same problem, how did you solved?
Please follow the debugging guide to setup XDebug: https://www.jetbrains.com/phpstorm/documentation/debugging/
If something isn't working after that - please share screenshots of your configuration.