New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support: XDEBUG not working in WSL2 environment (docker-ce inside WSL2) with phpstorm on windows #4242
Comments
Hi @mvinaj -
Could you please go more carefully through the troubleshooting steps? For example, you should have been doing |
Hi @rfay
Could you please go more carefully through the troubleshooting steps?
telnet host.docker.internal 9003, not just telnet host.docker.internal: Iam sorry i missed to copy the full command |
Please don't change the port. Please remove any custom configuration. I imagine your problem is
The solution there may work for you, #3772 (comment) Also, please make sure you have done the normal troubleshooting things:
|
The temporary solution to this problem is in Closing this in favor of the other issue. Please let me know how the solution works for you. |
@rfay the solution didnt work for me still the same erros |
If it's still showing "host.docker.internal" in the error, then you didn't set up the php config with the proper IP address. Please reply in the open issue, and say exactly what you did and exactly what the results were. You can say that you're coming from this issue. But note that if it still is trying to connect to host.docker.internal, I don't think you changed the php config properly. |
if it's still showing "host.docker.internal": "NOTICE: PHP message: Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: 172.20.16.1:9003 (through xdebug.client_host/xdebug.client_port) :-(" please reply in the open issue, and say exactly what you did and exactly: i will Thanks for all your help |
I'd be happy to do a screenshare with you to see if we can sort this out. I'm in US MT (UTC-6). Let me know what would be a good time for you. In the meantime, please carefully go through the troubleshooting steps using the new IP address. But I'm surprised to see an IP like 172.20.16 - that's what you found in your WSL2 distro's /etc/resolv.conf? Maybe you can paste the /etc/resolv.conf here. (That IP addr looks like what you might find inside the container, not in the WSL2 distro) |
/etc/resolv.conf:
in
|
Yes, but in your testing you were not using
|
And, of course, try the troubleshooting steps in the doc, using |
Yes, but in your testing you were not using 172.20.112.1, you were using 172.20.16.1: i think i need to disbale the automatic generation of this file. loading the .ini Using custom PHP configuration: [/home///.ddev/php/xdebug.ini] ddev logs: in the container: telnet 172.20.112.1 9003 |
Please go through the troubleshooting steps. Have you enabled listen in PhpStorm? Please do it step by step. And please make sure you have disabled your firewall/VPN/Virus checker. |
As I said above, I'm happy to do a screenshare call with you to sort this out. WSL2 is complicated in terms of networking, and different situations may result in different learning. |
i think its a good idea to do a screenshare. iam from germany so we only need to find the right time |
Hi @mvinaj - I can do today (Tuesday) between now (2:17pm your time) and 4pm your time, at 4:30pm your time, or tomorrow (Wed) between 3pm and 5pm your time. Let me know. It would be easier to schedule this more interactively in DDEV discord |
Thanks for taking the time to look at this today. It seems that your employer has locked down your computer in a way that WSL2 can't make a connection to Windows (where you have PhpStorm running). Our ideas for workarounds for you:
Your IT department also seems to have DNS rebinding prohibited, which is why you have to edit the windows hosts file. This would probably also be resolved by running your browser inside wsl2. https://ddev.readthedocs.io/en/latest/users/basics/troubleshooting/#dns-rebinding-prohibited Hoping something works! Closing this for now, but happy to follow up any time. |
…ixes #4242, fixes #3772, fixes #3813 (#4252) * Make host.docker.internal work with docker-installed-inside, fixes #4242, fixes #3772 * For WSL2 with Windows browser, docker-ce, parse /etc/resolv.conf * Require Docker 20.10 so we can use extra_hosts always * Add xdebug-ide-location to global config [skip ci]
Hi @rfay, sorry for the late response. I found the solution for my setup. I needed to update my Windows Defender Firewall after i enabled both Phpstorms. It worked for me. |
I'm glad you got it solved. Firewall is the first thing on the troubleshooting list :) Some companies just make it too hard, don't they. |
Just for the log: ran into the same issue. Firewall setting solved it. Thanks @mvinaj |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Yes, please comment in appropriate places. Otherwise you just create confusion. Commenting in unrelated repositories with out-of-date suggestions is not helpful. |
Is there an existing issue for this?
Run a Diagnostic and Paste Link Here
Expected Behavior
xdebug works out of the box If I start my ddev project and activate xdebug.
Actual Behavior
i get a error
ddev logs show :
WARNING: [pool www] child 2706 said into stderr: "NOTICE: PHP message: Xdebug: [Step Debug] Could not connect to debugging client. Tried: host.docker.internal:9003 (through xdebug.client_host/xdebug.client_port) :-("
in the container:
PING host.docker.internal (172.17.0.1) 56(84) bytes of data.
Trying 172.17.0.1...
telnet: Unable to connect to remote host: Connection refused
/etc/hosts
172.17.0.1 host.docker.internal
Steps To Reproduce
docker running in WSL
phpstorm on windows
ddev xdebug on
enable lisener in phpstorm
Anything else?
The text was updated successfully, but these errors were encountered: