Let's say I have two microservices running in two different Docker containers: ServiceA and ServiceB. ServiceA makes an HTTP request to ServiceB and this one sends a response back. I would like to be able if it is possible, to start my debugging session in ServiceA (instance of PhpStorm) and switch it to ServiceB (instance of PhpStorm) once the call is sent and then get back to ServiceA. To be clear, I will have two PhpStorm windows opened: one for ServiceA and one for ServiceB.
Here are some notes from my current configuration:
- ServiceA: PHP 7.4.x, Xdebug 3.0.4
- ServiceB: PHP 7.2.x, Xdebug 3.0.4
The Xdebug settings are the same for ServiceA and ServiceB:
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.discover_client_host=true
As per the File | Settings | PHP | Debug configuration in PhpStorm they look as follow and are the same for ServiceA and ServiceB:
Since ServiceB should be Listening for Incoming connection this is how that little green bug toolbar looks like:
What issues I am having?
- I am able to start the debugging session in
ServiceAbut it never switches toServiceB, the session finishes correctly though. - The following "warning" spam my
stdoutlogs forServiceB:
Xdebug: [Step Debug] Could not connect to debugging client. Tried: 172.18.0.9:9003 (from REMOTE_ADDR HTTP header), localhost:9003 (fallback through xdebug.client_host/xdebug.client_port)
What I could be possibly missing here?
Note: if more information is needed just ask me and I will add it

