3 Commits

Author SHA1 Message Date
Yassine Guedidi 4d28e660e9 Switch XDebug to trigger mode
In always-on debug mode (start_with_request=yes, the default), every PHP
invocation attempts to connect to the IDE debugger and logs an error when
nothing is listening. This pollutes terminal output during normal development.

Switch to trigger mode so XDebug only initiates a debug session when
explicitly requested:
- CLI: prefix commands with XDEBUG_TRIGGER=1
- Web: set the XDEBUG_TRIGGER cookie or query parameter (use the Xdebug
  Helper browser extension for convenience)

Also remove XDEBUG_TRIGGER=yes from the env file. That line set the trigger
env var unconditionally, which would have caused XDebug to always fire even
in trigger mode.
2026-03-20 21:54:10 +01:00
Yassine Guedidi e15e582756 Fix XDebug host connectivity in Docker
XDebug defaults client_host to 'localhost', which inside a Docker container
resolves to the container itself rather than the host machine where the IDE
debugger is listening. This causes every PHP invocation to fail with
'Could not connect to debugging client. Tried: localhost:9003'.

Add extra_hosts to the php service so that host.docker.internal resolves to
the Docker host IP via host-gateway. This works on all platforms (Docker
Desktop on macOS/Windows, native Linux Docker, WSL2).

Set XDEBUG_CONFIG=client_host=host.docker.internal in the xdebug env file so
XDebug connects to the host machine instead of the container.

Also remove the now-stale commented port binding (9000:9000 from XDebug 2).
XDebug 3 makes outbound connections from the container to the IDE — no port
publishing is needed or appropriate.
2026-03-20 21:54:10 +01:00
Kevin Decherf f51008aef0 Update docker-compose and Dockerfile for dev env
This change should ease the spawn of a development environment.
It can be used as a vscode devcontainer.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
2022-04-04 10:10:55 +02:00