markshust / docker-magento

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

Xdebug on bin/magento doesn't work (Docker on Mac) #1221

Open gkopec opened 2 months ago

gkopec commented 2 months ago

I tried to use this video instructions: https://courses.m.academy/courses/set-up-magento-2-development-environment-docker/lectures/36677538 to set up Xdebug on CLI commands. But PHPStorm is showing me this:

image

Here is the command it produced:

"[docker-compose://[/Users/genius-dev/Workspace/projects/tip/b2c/compose.yaml, /Users/genius-dev/Workspace/projects/tip/b2c/compose.dev.yaml]:phpfpm/]:php" -dxdebug.mode=debug -dxdebug.client_port=9000 -dxdebug.client_host=docker.for.mac.localhost /var/www/html/bin/magento

I already tried to set up host.docker.internal but it didn't resolve the issue:

image

Xdebug works with HTTP connection without any problems but I can not force it to debug CLI commands.

Hawksama commented 2 months ago

Can you try running cli command using this bash file?

https://github.com/Hawksama/docker-magento/blob/master/compose/bin/php-xdebug