Skip to content

Commit 515a899

Browse files
chapterjasonclaude
andcommitted
Target Xdebug at loopback, not host.docker.internal
host.docker.internal only works when the IDE and the workspace share a Docker host — true for local docker-compose, false for Coder, where the workspace runs on a remote deployment and the IDE lives on the developer's laptop. JetBrains Gateway and VS Code Remote set up reverse SSH tunnels to the workspace container, so the IDE's debug listener is reachable at 127.0.0.1:9003 from inside the container. Point client_host there and pin client_port=9003. Keep discover_client_host=true for web-request flows where REMOTE_ADDR identifies the caller. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1e5a3ab commit 515a899

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

scripts/php/xdebug.ini

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
; XDEBUG_MODE=debug php …
88
; or per-request with the XDEBUG_TRIGGER cookie / GET / POST / env var.
99
;
10-
; client_host=host.docker.internal targets the Docker host running the
11-
; workspace container; discover_client_host finds the right IP if the
12-
; IDE is elsewhere on the network.
10+
; client_host=127.0.0.1 targets the IDE via the reverse SSH tunnel that
11+
; JetBrains Gateway / VS Code Remote set up when connecting to a Coder
12+
; workspace — the IDE's debug listener is reachable inside the container
13+
; at loopback. discover_client_host covers web-request debugging where
14+
; REMOTE_ADDR / X-Forwarded-For reveals the caller.
1315
xdebug.mode = off
14-
xdebug.client_host = host.docker.internal
16+
xdebug.client_host = 127.0.0.1
17+
xdebug.client_port = 9003
1518
xdebug.start_with_request = trigger
1619
xdebug.discover_client_host = true
1720
xdebug.log_level = 0

0 commit comments

Comments
 (0)