markshust / docker-magento

Mark Shust's Docker Configuration for Magento
https://m.academy/courses/set-up-magento-2-development-environment-docker/
MIT License
2.59k stars 1.01k forks source link

Run xdebug from command line #579

Open Cloudy777 opened 3 years ago

Cloudy777 commented 3 years ago

Question

Is ist possible to run bin/magento s:up with xdebug on ?

I have tried the following: 1) run directly via terminal bin/xdebug enable bin/magento s:up (with breakpoint set) -> Doesn' stop at breakpoint

2) add php script in phpstorm

XDEBUG via browser works fine, everything is set up as documented.

Thank you for your input

markshust commented 3 years ago

Yea let's keep this issue open... this has been requested a few times. I haven't looked into this because I've never had to do this, but if someone wants to chime in with instructions on how to set this up, that would be greatly appreciated.

Cloudy777 commented 3 years ago

In the end it is a simple configuration step:

After that set up a new Run Configuration:

Integration Tests can be debugged with this configuration as well.

markshust commented 3 years ago

@Cloudy777 thanks a ton for this, I created a new video lesson for it in the course https://courses.m.academy/courses/set-up-magento-2-development-environment-docker/lectures/36677538

malikabid commented 2 years ago

@markshust - Thank you for the instructions, but how can we do the same thing in VSCode.

markshust commented 2 years ago

Good idea @malikabid -- I'll test and add a video for this.

malikabid commented 2 years ago

Hi @markshust

Today I was able to do the debugging from command line including bin/magento and integration tests. I just added the link in docker-compose.dev.yml

environment: XDEBUG_CONFIG: "idekey=VSCODE client_host=host.docker.internal client_port=9003"

and restarted the containers (bin/restart)

markshust commented 2 years ago

Appreciate it @malikabid, I re-opened this ticket so we could potentially add this info either to the README or to the docker-compose.dev.yml file itself.