Problems with use in Windows 10
- [ ] I have tried with the latest version of my channel (Stable or Edge)
- [x] I have uploaded Diagnostics
- Diagnostics ID: AE14A586-A829-4A0A-90FD-30B1D3282D4E/20201030133254
Description
Here are the problems that occur: 1 - The Windows notification area displays alerts. I click to see more and nothing happens.

See also this link. I don't know what to say other than the image.
2 - I'm trying to use Xdebug (debug for PHP) and the default settings don't work. As researched in the forums, this is due to network problems due to the use of WSD2 in Windows 10.
I run Docker (Docker version 19.03.13, build 4484c46d9d) directly on the Microsoft Windows 10 Home Single Language (version 10.0.19041 Compilation 19041). The VSCode (version 1.50.1) is also on the machine, but cannot hear anything that is transmitted via the container.
The image used is for the purpose of running Wordpress and can be seen at: alessandroemerich/wordpress:latest.
The project I use for these tests can be seen at: https://github.com/aleemerich/wp-docker-package
The Apache / PHP 7.4 settings contained in the container are:
- xdebug.remote_enable = 1
- xdebug.remote_connect_back = 1
- xdebug.remote_autostart = 1
- xdebug.remote_host = host.docker.internal
- xdebug.remote_port = 9000
From what I've studied, the problem is in using the "host.docker.internal" parameter.
Links I saw about the problem: https://stackoverflow.com/questions/62104199/issues-when-debugging-php-in-vscode-using-docker-and-wsl2 https://stackoverflow.com/questions/48546124/what-is-linux-equivalent-of-host-docker-internal/61001152
Adding links I saw about the problem.
Did you try ping host.docker.internal from inside container?
Also check PHP builder with xdebug enabled -> php -v should contains xdebug version.
ping host.docker.internal result
root@c4a30be6457c:/var/www/html# ping host.docker.internal PING host.docker.internal (192.168.65.2) 56(84) bytes of data. 64 bytes from 192.168.65.2 (192.168.65.2): icmp_seq=1 ttl=37 time=0.967 ms 64 bytes from 192.168.65.2 (192.168.65.2): icmp_seq=2 ttl=37 time=1.11 ms 64 bytes from 192.168.65.2 (192.168.65.2): icmp_seq=3 ttl=37 time=1.73 ms 64 bytes from 192.168.65.2 (192.168.65.2): icmp_seq=4 ttl=37 time=1.92 ms 64 bytes from 192.168.65.2 (192.168.65.2): icmp_seq=5 ttl=37 time=1.76 ms 64 bytes from 192.168.65.2 (192.168.65.2): icmp_seq=6 ttl=37 time=1.88 ms ^C --- host.docker.internal ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 73ms rtt min/avg/max/mdev = 0.967/1.560/1.920/0.381 ms
php -v result
root@c4a30be6457c:/var/www/html# php -v PHP 7.4.11 (cli) (built: Oct 13 2020 10:01:40) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.11, Copyright (c), by Zend Technologies with Xdebug v2.9.8, Copyright (c) 2002-2020, by Derick Rethans
Looks pretty good, should work. Is your IDE started and listening for xdebug connections on 9000 enabled? Also try disable windows firewall for a while.

Did not work... :(
Look more like PHP or IDE problem than a docker. Try install telnet inside a container and do telnet host.docker.internal 9000
But why would host.docker.internal 9000 have to be available without Docker interference? This should be an inherent Docker configuration, since it is a Docker policy, right?
In fact, I think it's a communication problem between WSL2 and native Windows applications (from what I'm researching). So, Docker should contain some configuration to predict this, right? This is the reasoning line I have if Docker has the idea of running multiplatform (avoid the "my machine works" problem).
Anyway, just weighing ... Laughter. Thanks for the help anyway.
You are right, xdebug should connects from inside docker with php to your host (windows) ide port 9000 using host.docker.internal as dns for resolving host ip. So far your configuration looks correct and somehow works for me. I'm talking to use telnet inside container to just check ide is actually listening in port.
I didn't understand "telnet inside container". The container is Linux, right? Telnet on windows does not find this address, but this address is not used externally anyway, at least in the settings I reviewed and in VSCode.
Container is a running docker. Use docker-compose exec
I thought the idea was to test on Windows ... Follow the test result in the container:
root@c4a30be6457c:/var/www/html# telnet host.docker.internal 9000 Trying 192.168.65.2... Connected to host.docker.internal. Escape character is '^]'.
Looks working. Since you can connect to port, then ide is actually waiting for xdebug connection. Check you place breakpoint inside your code. Also you may need to configure path mapping between your windows code path and path inside docker.
Thank you. Do you have any tips or links to help with this mapping issue?
https://dev.to/fuxide/setting-up-xdebug-for-vscode-in-an-docker-environment-27a9 maybe this
https://dev.to/fuxide/setting-up-xdebug-for-vscode-in-an-docker-environment-27a9 maybe this
I've retried these steps dozens of times. It seems that VSCode cannot hear anything, and Debug does not work. Let's see if anyone else has any suggestions here. Thanks again.
What helped me was:
adding this line to dockerfile:
&& docker-php-ext-enable xdebug
and have all the settings in dockerfile (now I have nothing in docker-compose related to xdebug)
Full spec of dockerfile is
RUN pecl install -f xdebug \
&& docker-php-ext-enable xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_host=172.20.184.87" >> /usr/local/etc/php/conf.d/xdebug.ini
Be aware of changing IP address after every reboot.
What helped me was: adding this line to dockerfile:
&& docker-php-ext-enable xdebugand have all the settings in dockerfile (now I have nothing in docker-compose related to xdebug)Full spec of dockerfile is
RUN pecl install -f xdebug \ && docker-php-ext-enable xdebug \ && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ && echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \ && echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini \ && echo "xdebug.remote_host=172.20.184.87" >> /usr/local/etc/php/conf.d/xdebug.iniBe aware of changing IP address after every reboot.
Hello. I added the line "docker-php-ext-enable xdebug" in docker file (see Dockerfile-wp), but I don't change the result. The other lines were already added (see docker-entrypoint.sh).
The only point I didn't understand is to put the IP. I am running Docker Desktop (Windows 10 and using WSL2), so the IPs that are used by the containers are not available for me to access directly from my Windows (the IPs are in different classes). On my Windows, I have ips 192.168.0.x. Inside the containers there are the IPs 192.168.65.x and 172.x.x.x.
Only using the word "localhost" can I access the container with Apache and Wordpress (from Windows into the container). If I try to use IPs, I can't. When I query my localhost, the result is ":: 1", so how would I work with the IP in the settings you mentioned?
A do access WSL server on IP given by ifconfig (eth0 interface):
That's the one I put to xdebug.remote_host before initializing docker containers (by docker-compose up -d --build). I need to check the IP and change it every time, but it works.
What helped me was: adding this line to dockerfile:
&& docker-php-ext-enable xdebugand have all the settings in dockerfile (now I have nothing in docker-compose related to xdebug) Full spec of dockerfile isRUN pecl install -f xdebug \ && docker-php-ext-enable xdebug \ && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ && echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \ && echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini \ && echo "xdebug.remote_host=172.20.184.87" >> /usr/local/etc/php/conf.d/xdebug.iniBe aware of changing IP address after every reboot.
Hello. I added the line "docker-php-ext-enable xdebug" in docker file (see Dockerfile-wp), but I don't change the result. The other lines were already added (see docker-entrypoint.sh).
The only point I didn't understand is to put the IP. I am running Docker Desktop (Windows 10 and using WSL2), so the IPs that are used by the containers are not available for me to access directly from my Windows (the IPs are in different classes). On my Windows, I have ips 192.168.0.x. Inside the containers there are the IPs 192.168.65.x and 172.x.x.x.
Only using the word "localhost" can I access the container with Apache and Wordpress (from Windows into the container). If I try to use IPs, I can't. When I query my localhost, the result is ":: 1", so how would I work with the IP in the settings you mentioned?
It worked!
After all the tests, it started to work when I changed some Xdebug configurations:
- I changed "xdebug.remote_enable = 1" -> "xdebug.remote_enable = on"
- I changed "xdebug.remote_autostart = 1" -> "xdebug.remote_autostart = on"
- I kept "xdebug.remote_host = host.docker.internal"
- I removed "xdebug.remote_connect_back = on"
I believe this problem was due to php 7.4 (the configuration I was basing on was php 7.2).
I thought it had something to do with the networks, but I don't think so. As a final proof, I will format my entire machine and try to install everything again to see if it works.
Thanks!
@aleemerich FYI the next version of xdebug changes some things in the configuration logic. http://xdebug.org/announcements/2020-10-14 Only to warn you that it could be possible that your now working settings could be non-working in the future 😄