-
-
Notifications
You must be signed in to change notification settings - Fork 656
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 Documentation #575
Comments
Your are not the only person who encountered exactly the same issue. Xdebug and Docker is in my eyes really a pain, because of the |
I will draft an PR on this with the information I currently have. Please be noted that I do not have a Windows machine to test with, so I will rely on the information provided. Hope we can get this right and well documented this time. |
Great, thanks - looking forward to hopefully getting it working :) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Bumping to keep the issue from closing. Still unable to configure xdebug without hardcoding my PC's actual IP address. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
...Still no solution (4mo later), so no, this should not be marked as stale. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
...Still no solution (6mo later), so no, this should not be marked as stale. |
i've experienced a similar issue, |
With xdebug 3 the documentation really needs a refresh. Would like to help but I am still not able to configure it on linux. |
Has somebody bean able to configure devilbox using xdebug 3 using PphStorm on linux ? |
Solution for PHPStorm and Linux (Ubuntu 20.04)After 6 hours of tries I finally manged to run xDebug. Config: Step 1
Copy the following content into newly created file, its copied from devilbox-php.ini-xdebug file in the same folder xdebug.mode = debug ; This is the REQUIRED extra bit PHPStorm hints you to add this in php.ini Step 2
Basically the devilbox docs says to put 0.0.0.0 in the host, you actually have to put the external_host IP of php image Step 3Step 4That's It, Happy debugging. You can add browser specific debuger plugin as well (Optional) |
@ARehmanMahi hello, I installed PHPStorm and tried to follow your suggestions, but still I cannot make it work... maybe I am missing something trivial, but still cannot figure it out.
Once I access my project on the browser via https://mytest.loc no breakpoint get triggered. |
@masiorama xdebug.ini must contain Also in my answer step 3, make sure you have enabled start listing, the green telephone icon. P.S. I've ubuntu install locally, and all the docker stuff was experimental stuff for me, and it turned out to be more hassle then improvement, I Installed LAMP stack and am very happy now, I also do manage my own VPN for testing and stuff with clean lamp stack, works perfect for me. Like PHPStorm does't support remote NodeJS the way it does php/xdebug. I needed that for my JS validation plugin. The mainter of this repo rarely reply and is only contributor so its kind of a dead project for me. End of rant. Good luck |
Hi @ARehmanMahi, actually the ip is there... Or you mean something different? I also triggered the Start Listening button. You mean that you are using a LAMP stack instead of the devilbox env? Thanks! |
@masiorama yeah, my bad, you have the IP there, by the way I noticed you are using the vwsl linux on windows. I'm actually on ubuntu, and Yes I'm using lamp stack instead of docker. Its way easier and customiseable than devilbox once set correctly. P.s. On windows Laragon is The Best I've had used. (PHP, wordpress, laravel and more) |
@ARehmanMahi exactly, I'm on wsl2 (ubuntu + docker + devilbox). |
I managed to make it work with Win10 + WSL2 (Ubuntu 20.04): inside WSL2 I installed docker, docker-compose and devilbox. I can debug from VSCODE installed on Win10. |
Hi @masiorama , I am trying to do the same. Can you please provide a guide on how you did it? Thanks in advance. |
Hi @geeksupport1, sure, I will help you if I can. I wrote a complete guide in 6 steps/pages on my website, but it is in italian. Let me know if you can follow it. |
Hi @masiorama, Thanks for the link. I think devilbox is great if you have a linux machine, But on WSL2, as the founder does not use WSL2 there will continue to be problems. After trying it for 2 days, I gave up. I followed The VSCode tooling does all the config for you and a directory and creates 2 files to make it work:
Things are changing fast. |
Just to mention, I work with xdebug on wsl2+devilbox without issues. |
Thanks,
Can you outline the setup in a wiki some where.
I could not get it to work.
…On Tue, 3 Jan 2023, 5:31 pm masiorama, ***@***.***> wrote:
Just to mention, I work with xdebug on wsl2+devilbox without issues.
—
Reply to this email directly, view it on GitHub
<#575 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALCJZLFILDC227FHBONEGTWQPIWJANCNFSM4HLCRVPA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Let's continue in the aggregated thread here: #946 |
ISSUE TYPE
SUMMARY
Ambiguity with xDebug on Docker Toolbox setup
Goal
To get xDebug working properly on Docker Toolbox, & clarify the docs to make it easier for others.
I've been struggling for several hours, still unsuccessfully, to get xDebug working on Docker Toolbox, based on the docs here: https://devilbox.readthedocs.io/en/latest/intermediate/configure-php-xdebug/toolbox/vscode.html.
The first confusion was with the 'Prerequisites': it mentions that you need to forward host port 9000, but then gives two different links. Which should we use? I believe the answer is that you can choose either one (based on https://github.com/cytopia/devilbox/blob/master/docs/advanced/connect-to-host-os.rst#id6). That clarification would help.
Since I'm on Windows & don't have an SSH server running, I went with https://devilbox.readthedocs.io/en/latest/howto/docker-toolbox/ssh-port-forward-on-host-to-docker-toolbox.html. I launched the QuickStart Terminal & entered the example command - after which it prompts for the "docker" user's password. What should we use? After more digging around, I found that you should use the key like: ssh -R 9000:127.0.0.1:9000 [email protected] -i .docker/machine/machines/default/id_rsa. Having that in the example docs would've saved time.
As for actually getting it working...it still isn't, so there must be something I'm still missing/misunderstanding from the instructions. As an initial proof-of-concept though, I CAN get xdebug it working (hitting breakpoints) with php.ini like:
This proves that xdebug is fundamentally on, path mapping is correct, there's no firewall in the way, etc. However, when I change
xdebug.remote_host=docker.for.lin.host.internal
, the logs always show:This makes me think it's still something related to port forwarding. I also tried going into the VirtualBox machine's settings->Network->Adapter 1 (nat)->Advanced->Port Forwarding & added port 9000, but it didn't help. I tried some other setups found by digging around elsewhere - i.e. using IP 10.0.2.2 instead of docker.for.lin.host.internal - but nothing seemed to work.
Obviously hardcoding my host PC's current IP isn't a long-term solution (it's a laptop that moves around & gets different IPs), but this is where I remain stuck. It works if I give php the direct IP...but not if I use docker.for.lin.host.internal.
The text was updated successfully, but these errors were encountered: