Skip to content

When xdebug is enabled bin/magento commands won’t work

I’m using Mark Shuts docker version, If xdebug is enabled, bin/magento commands won’t work, and let’s say if i run bin/magento cache:clean PhpStorm starts to debug out of nothing.

Also I get this message in console:
Xdebug: [Step Debug] Could not connect to debugging client. Tried: host.docker.internal:9003 (through xdebug.client_host/xdebug.client_port) :-(

It was working perfectly and suddenly this started to happen, any ideas?

If I disable it everything works ok.

I’m on Ubuntu 20.04.6 LTS x86_64, and using phpStorm 2023.3.4, Docker Desktop 4.27.2, Magento Enterprise 2.4.6-p3.