moodlehq / moodle-docker

A docker environment for moodle developers
GNU General Public License v3.0
373 stars 244 forks source link

XDebug client_port #233

Closed meirzamoodle closed 1 year ago

meirzamoodle commented 1 year ago

In order to use Xdebug, we need to disable the firewall or open the port used in the xdebug.client_port.

scara commented 1 year ago

Hi @meirzamoodle, did you add the client_port setting for documentation purposes e.g. firewall settings? 9003 is the default port.

TIA, Matteo

meirzamoodle commented 1 year ago

Hi @scara,

Yes, the changes for example how to open the port.

meirzamoodle commented 1 year ago

Actually, there are other things to do if we're working with VSCode, Need to add a configuration in launch.json (configuration file from PHP debug extension), but I'm not sure if should i add it in the README file.

image

meirzamoodle commented 1 year ago

Hi @meirzamoodle,

I must confess that I'm not 100% sure if this sort of information corresponds here, this can become a thick book if every single detail is added, not to talk about individual IDEs/environment differences.

In any case, ok, let's give to this a pass. If things become out of control, we always can apply scissors in the future.

Please take a look to the suggestions and this will be ready to be merged. Thanks for your collaboration!

Hi @stronk7.

I just updated the changes based on your suggestion. Cheers!

NeillM commented 1 year ago

I have manged to get remote debugging working on PHPStorm with only a single change to the documented steps in the current README, that was to add an IDE key to the configuration, i.e.:

xdebug.idekey = moodle

However that might not be technically needed, but is probably useful in my case where I can have several different docker servers running with xdebug enabled.

My current setup has everything running on WSL2 containers.

stronk7 commented 1 year ago

I remember the idekey detail was discussed somewhere (relatively recently). Found it @ https://github.com/moodlehq/moodle-docker/pull/163 ... maybe we can go and add a side comment here about it (for whichever integrations needs it).

NeillM commented 1 year ago

The idekey may well not be needed (I didn't try without it) at least in PHPStorm it looks as though it should not be required

I suspect you might want one in cases where you are running for example multiple moodle-docker instances for different versions of Moodle or different patches so that only debugging calls for the code you are looking at get to the correct IDE (in this sort of case you would probably want different keys for each docker instance)

Or if you have completely different different applications running on various docker instances (for example I have a Moodle and our online exams system)

stronk7 commented 1 year ago

I'm happy if we add it (commented) with something saying that, depending on the IDE or environments, it may be needed to setup it.

Would you, @meirzamoodle ? I think that with that little addendum... this can finally land... ciao :-)

meirzamoodle commented 1 year ago

Hi, @stronk7.

I already planned to complete this last week. Sorry for the late git push. Cheers.

stronk7 commented 1 year ago

Thanks @meirzamoodle,

it looks perfect, I'll land this as soon as GHA tests end.

Ciao :-)