I have a container network created with docker-compose
. The xDebug settings are passed in part by the .yml
file and partly by a .ini
file consumed by PHP.
I know xdebug is installed correctly in the container because it appears in phpinfo()
and modifies the error outputs. I also know from the access logs that the container sees the connections coming from the host
on the IP 172.18.0.1
, which is an internal network IP created by Docker (in my network the IPs are 192.168.x.x
).
In the hosts file on my computer, I create entries in the format 127.0.0.1 example.com
to access the site through the browser. Everything okay, except that PhpStorm never receives information from Xdebug, even with the most diverse configurations, even with the current configuration - which would theoretically connect back to any IP that has a connected debugger:
[Xdebug]
xdebug.idekey = PHPSTORM
xdebug.default_enable = 1
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.remote_host = 172.18.0.1
xdebug.remote_log = /var/log/remote.log
If I understood xdebug well, what's missing now is a way to send debugging information to 172.18.0.1:9000
(from within the container) and this information is received on my computer ( 192.168.x.x:9000
). How to make this bridge?