Feature Request: Xdebug #14
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Thanks for this script. Just jumping back into development and giving it a try and wondering if there is already a way to enable Xdebug within the container using octojoom that I missed or if that might be possible to add-in to the script?
If it's already possible, within the script or with minor manual modifications of the script, let me know.
I know that we can add php.ini directives now but not sure how to actually add the Xdebug run command to get it started.
We previously considered adding Xdebug functionality but didn’t move forward with it. However, given the renewed interest, I’m open to incorporating it in a way that allows it to be easily enabled or disabled with a simple override.
I currently don’t use Xdebug myself, so I haven’t had the time to work through the setup. That said, I know others have asked for it, and I’d be happy to implement it if I have all the necessary details. If you can provide the exact configurations needed, such as where to modify settings, which ports need to be opened, and any additional changes required in
php.ini
I’ll make sure it can be toggled on or off easily.Let me know what’s needed, and I’ll take care of integrating it properly.
I'm still a bit of a newbee with docker, so I'm not completely sure how to set it up.
I know when dealing directly I just have to install xdebug and then add a link in PHP.ini to tell it where it is.
I do know that the default port is 9000.
I've gone through a number of docs online and all of them indicate adding RUN commands via the Docerfile. I thought I'd give it a test with my site here generated with octojoom, but I can't seem to find the docker file ... only docker-compose yaml - but I don't think that these are translateable, or able to run pecl from the docker-compose file. But again, I'm way over my head with that.
The one set of instructions that seems to almost work for me is:
https://phauer.com/2017/debug-php-docker-container-idea-phpstorm/
Although I'm using PHPStorm, so that's especially applicable for me, the first section of code is pretty generic (although the versions are outdated.
If you can point me in the direction of where to add the
RUN pecl install xdebug
(and other RUN) lines, I could do some work to test to get the details worked out test it a bit.BTW ... adding the php.ini parts works fine just adding manually within octojoom for now.
If there were a way to manually add those 2 RUN commands, then I think it would work.
So, if we have a Dockerfile, it would need to include:
And the PHP.ini will need to have added:
I think that should be it (with making port 9000 accessible)
BTW ... if you have a different debug utility that you recommend instead of xDebug, that can provide step debugging for PHP, I'd be open to use that, rather than trying to change Octojoom.
(I switched to Ubuntu so that I could use Octojoom, and if switching to a different debugger will put me more in-line with others using JCB, I'd be willing to switch to that also.)
We will be adding extra Images to the official docker images of Joomla, for xdebug. The has been decided months ago in the maintainers channel... I have just not had time to do it, as yet... so when this issue came up, I thought I could ask for some help with all the needed changes I need to make to the images... to ensure a stable dev ready set of images can be build. So we will first bump Joomla with a new set of images just for dev (extension focused development, not for Joomla core testing and development) and then we will improve OctoJoom to make full use of this 🚀
I didn't see a ticket over on the Joomla docker github page for this.
Let me know if there is some place to join in there.
I can't really help all that much with creating the code to do this, because I'm still new to the process of creating docker images, but I'm definitely willing to test out anything when needed (or help with documenting).
BTW ... I'm still working on migrating some J3 sites over to J4/5, so having xdebug available with the last J3 image would be helpful.
This was a conversation in the CMS Maintainers team meeting, and it was positively received... it is just the doing that remains.
Hi guys, here is my code to have it working. For PHP 8+ only.
in the Dockerfile.joomla obviously
Here is the way for older version up to PHP 7.4
I use it for older J3 projects I didn't migrate yet.
@vistamedia Are you using that with octojoom? Or just with your own docker images and builds?
@cpaschen With docker images, I don't use octojoom.
@vistamedia Sorry, one more question, are you using the official Joomla docker images, or the VDM ones or just your own custom built images?
I think I'm finally going to have to sit down and learn how to build my own docker images. Hopefully then I'll be able to more constructively contribute to this ticket, by creating, testing, and offering solution.
@cpaschen he is using the official Joomla docker image... in a docker file like this:
I am working on a set of images that will already have these features in it...
Thanks for all that info.
I spent quite a few hours trying to learn all the details of docker, but still run into issues.
So I'm just going to stick with Octojoom (and live with vardump() for debugging when needed).
I must say, Octojoom is WONDERFUL and very stable.
Having xDebug available via octojoom would be nice when you have time.
Just curious if you had a chance to add xdebug to any Joomla docker images?
(Or add the ability to octojoom to include xdebug)
If not (or even if so), I'd love to learn what method you are using besides xdebug to provide live debugging results when working with Joomla/JCB code.