Open wesleymusgrove opened 8 years ago
confirmed. I also can't see how this site an issue on ALL Xdebug setups using docker. so maybe we're missing something?
@wesleymusgrove I got this working from my docker container to HOST using docker for mac https://gist.github.com/ralphschindler/535dc5916ccbd06f53c1b0ee5a868c93
I'm not 100% sure why, but seems its possible to hookup guest & host without the requirements for the PORT assignments, so removing the hardcoded ports in the docker-compose (run command) will free up your IDE to listen. more discussion needed i think... but FYI ^^^
You don't need expose 9000 port, just remove from setup - "9000:9000" & EXPOSE 9000 .
For those having problems enabling remote debugging from a docker container (like I had for about 5 hours), here's a config that works without changes:
xdebug.remote_enable=1
xdebug.remote_host=host.docker.internal
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.remote_autostart=0
xdebug.remote_connect_back=0
In sublime text 3, use these settings:
"path_mapping": {
"/var/www/site/" : "K:/dev/github/php-dev/dev/",
},
"ide_key": "sublime.xdebug",
"host": "127.0.0.1",
"port": 9000,
Adjust the path_mapping to your situation and make sure your docker-compose does not map port 9000:9000 at all as otherwise it won't work. Here's a docker example.
Also I think the issue can be closed as it's clearly a docker issue and not the plugin.
@8ctopus I am having the same problem and I am trying to apply your configurations. However, I am a total docker newb. Where does the following go?
xdebug.remote_enable=1 xdebug.remote_host=host.docker.internal xdebug.remote_port=9000 xdebug.remote_mode=req xdebug.remote_autostart=0 xdebug.remote_connect_back=0
@serverjohn within the docker container /etc/php7/conf.d/
. Look for the xdebug.ini
config file. In my case the name is 50_xdebug.ini
. You may want to checkout the docker container I built as it all works out of the box.
I am having an issue related to https://github.com/martomo/SublimeTextXdebug/issues/63. Closing down multiple Sublime windows did not fix it for me.
See @trungdq88's post: http://stackoverflow.com/questions/35532325/docker-port-conflict-on-ubuntu/35532956 for a detailed explanation on why Sublime cannot listen to port 9000, 9001, or whichever port you are trying to listen for xdebug.
I also receive the following error in Sublime: "Xdebug Client.xdebug.protocol.ProtocolConnectionException: [Errno 98] Address already in use" because the
docker-proxy
process is already listening to port 9000.Host:
SublimeTextXdebug User Settings:
Guest:
20-xdebug.ini:
docker-compose.yml:
Dockerfile:
Output of
tmp/xdebug.log
: It immediately closes as soon as it connects to the clientOutput of Sublime Text console:
As shown in the above mentioned StackOverflow issue, changing the HOST:CONTAINER port mapping to something like
12345:9000
doesn't work because on the HOST thedocker-proxy
process listens to port 12345 and Sublime still cannot listen to port 12345 because it's already in use.Is there some way for Sublime to listen to port 9000 even if another process is also listening on that port?
As far as I can see, this is like an infinite circle of doom, where Sublime will never be able to listen to xdebug requests coming from a docker container because of the
docker-proxy
service running on the same port that Sublime needs to be listening to on the host.