-
-
Notifications
You must be signed in to change notification settings - Fork 655
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
XDEBUG on Windows not working #209
Comments
"pathMappings": {
"/shared/httpd/wordpress1": "${workspaceRoot}/data/www/wordpress1/htdocs"
} From an initial view, the paths don't match. Shouldn't the left be Also here is some other information I just found: https://stackoverflow.com/questions/37478387/how-to-setup-xdebug-and-phpstorm-with-docker-for-windows-beta Are you using native Docker or Toolbox for windows?. Either way I am happy to get this sorted with u as i am currently writing the documentation for xdebug and windows is still the missing part. |
What you should do is:
xdebug.remote_connect_back=0
xdebug.remote_host=192.168.246.1 But waitYou need to change the IP address and use your own. How to get your IP address: In a Windows command-line, run “ipconfig” and look for the IP4 address in “DockerNAT” entry. 192.168.246.1 in my case Let me know if this works Edit: Credits to this post: https://forums.docker.com/t/solved-how-to-setup-xdebug-and-phpstorm/13641/23 |
I've had a similar issue in the past with 10UP Docker and solved it as outlined here 10up/wp-local-docker#53 but it recently broke again. Pita to fix. I'll try out the above and see if I can get it working. ty. |
I got XDebug working with the PR: #203 but with some modification to your instructions. Here's the configuration, assuming you are using PR: #203 xdebug.remote_enable = 1 Note: xdebug.remote_host should be the IP Address of the Hyper-V Virtual Ethernet Adaptor, not DockerNat IP address. You can see this in Win 10 Task Manager performance tab or use ipconfig Also Note: this is different from what they say here https://forums.docker.com/t/solved-how-to-setup-xdebug-and-phpstorm/13641/23 but it's what works on my system using Native Docker for Windows VSCode Launch.json
} |
Great, I will add it to the documentation. New docs are going to be around here, but are still under development: http://devilbox.readthedocs.io/en/documentation/ |
Generalized Xdebug documentation now available: https://devilbox.readthedocs.io/en/latest/intermediate/configure-php-xdebug.html |
Thank you so much, this point was ultimately was did it for me. I've been banging my head against this all afternoon, and using that IP isn't documented anywhere but your comment as far as I can tell. |
@erythro thanks for pointing this out. I will reopen this issue until the documentation is updated accordingly. |
@erythro could you also check to see if the following xdebug.remote_enable = 1
xdebug.remote_connect_back=0
xdebug.remote_autostart = 1
xdebug.remote_host = host.docker.internal |
Hi @cytopia thanks, I'll give a more full explanation here, though I'm a bit out of my depth. I slightly misunderstood the comment I quoted. I suspect the problem might have been related to some messing around with virtualisation I did ages ago with the hyper-v manager. I wanted to create an ubuntu virtual machine, but followed a guide, and part of that guide was creating a virtual switch so my virtual machine could have access to the internet (iirc). Here's an anonymised screenshot of the output of ipconfig: The thing that finally worked for me was setting the remote_host to 192.168.0.12, the value from "New Virtual Switch". So is it possible I set up that virtual switch in such a way that it interfered with the Devilbox and/or Docker? Here's a screenshot of the configuration of the switch: So the settings you asked me to use didn't work for me, but I assume that's because I wasn't actually using vEthernet (Default Switch). |
@erythro thanks for the screenshots, I have added the information to the documentation and differentiated between two case:
Documentation:
|
This is broken for me again now and I can no longer get XDebug to work. Update: Fixed by doing the following using the vEthernet (Default Switch) IP address as outlined previously |
Using IP address of vEthernet (Default Switch) instead of DockerNAT works for me on windows with docker desktop! |
I have rewritten the documentation and hope it does no present what actually needs to be done in Release v1.0.1 https://github.com/cytopia/devilbox/releases/tag/v1.0.1 |
It's suddenly no longer working for again. The instructions also seem different again as well. eg: now in Launch.Json you say but it used to be
Xdbug is set up correctly, it's listening on 9000 as verified in Windows Resource monitor but it won't jump into a breakpoint doing a simple test with phpinfo. I just pulled the latest Devilbox as well. This is really frustrating as Xdebug is a critical need atm. |
Update: To test if it was a problem with my machine and/or Docker I've installed https://github.com/10up/wp-local-docker-v2 and successfully connected to XDebug I still can't get Devilbox Xdebug working again so sadly will have to switch to 10up, as XDebug is essential to me. |
Windows 10 Pro 1709 16299.248
docker version
Version 17.12.0-ce-win47 (15139)
docker-compose version
1.18.0
I'm trying Devilbox as an alternative to other Docker Wordpress setups I've been using.
I'm managed to get it working up to the point of a WordPress install, all hooked up and working fine.
It's very fast, much better than 10ups Docker for WP.
However, I can't get XDEBUG from VSCode to attach. Without debug, it's pretty much useless.
I'm pretty certain I need to use the vEthernet Default Switch IP address, and Code is definitely listening on port 9000 when I enter debug mode. But it doesn't hit breakpoints at all, so it's obviously not connecting.
Could it be the path mappings are wrong in the Launch Config?
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
}
Any tips?
The text was updated successfully, but these errors were encountered: