-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add xdebug support. #31
Conversation
Hi @micaherne,
TIA, |
3fe3715
to
48201fe
Compare
Hi Matteo, thanks for the quick peer review, it's very much appreciated.
I'll see about getting a pull request into the moodle-docker project too. Thanks again, Michael. |
Hi @micaherne,
This will IMHO help people when deciding what they should provide via TIA, |
48201fe
to
bbed8a0
Compare
Thanks again, Matteo! I've added your suggested patch. I see what you're getting at now. The way I was looking at it was that people who want to use Xdebug already know what they're doing, and they can work out what settings they need to set from the documentation, but I guess it's useful to signpost some of the more-used config settings for people who are just getting started with Xdebug too. Cheers, Michael |
Hi, thank you very much for this patch! Recently, I've tried to get XDebug working with this patch together with Moodle Docker and PHPStorm. However, this patch as is unfortunately did not work out for me and it took me quite a while to find the solution. My solution to get this working (I'm operating on a Mac):
I don't know if this also works on Windows? If it does, it would be great to change the patch one more to address this fix. And moreover, it would be really appreciated if this could then be exported to the Docker Hub! (Currently I needed to clone this repo locally and build the image in my Moodle Docker container manually.) Futhermore, I've never used this code mentioned in the readme: Best, Kathrin |
@Kathrin84 That should also work with windows because you are essientally setting up xdebug to work over a remote connection. The ideal way is to leave xdebug.remote_host as localhost and then connect using ssh proxying as listed here but not sure how that would work in a dockerized setup since the host machine can't reference the container by name. But figured someone may find the information helpful if running docker on a remote machine and want's to connect using phpstorm. |
Hello Everyone, It would be nice to provide these examples in the README too since the configuration of The key point is that both the machine hosting the IDE and the machine hosting docker running this container should connect each other, the first to consume web requests served by the container over HTTP and the latter to connect back to the machine hosting the IDE to "remotely" debug the application via the TNX @Kathrin84 for raising your issue w/ Mac 👍 . So we need to improve the patch to highlight the settings for "common" local envs:
HTH, |
Looking forward to have xdebug support in moodle-docker. Thanks all. |
3954ec8
to
fe69e99
Compare
a4865f6
to
2a8ac52
Compare
I'm closing this now, because as of #173, xdebug is now installed (disabled by default) in all the >= php74 images. Plus readme tells how it should be enabled on container creation. Ciao :-) |
Here's a patch for xdebug support (#17). It installs the module but leaves it disabled. The module will be enabled if there is a non-empty XDEBUG_CONFIG environment variable.
I thought it would be better to use the existing XDEBUG_CONFIG environment variable rather than introduce a new one, as realistically you're likely to want to configure xdebug if you enable it. In the event that someone wants it to run with all the default settings - which will probably be rare - you can just pass one of the default settings to enable it (e.g. XDEBUG_CONFIG="default_enable=1")