; See https://docs.docker.com/desktop/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host ; See https://github.com/docker/for-linux/issues/264 ; The `client_host` below may optionally be replaced with `discover_client_host=yes` ; Add `start_with_request=yes` to start debug session on each request xdebug.client_host = 'host.docker.internal' ; Enable Xdebug only for web server requests zend_extension=xdebug.so xdebug.mode=develop,debug xdebug.start_with_request=trigger xdebug.discover_client_host=1 xdebug.client_host=host.docker.internal ; Disable for CLI [cli] xdebug.mode=off