You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: distribution/debugging.md
+28-6Lines changed: 28 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -43,12 +43,13 @@ services:
43
43
# See https://docs.docker.com/docker-for-mac/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host
44
44
# See https://github.com/docker/for-linux/issues/264
45
45
# The `remote_host` below may optionally be replaced with `remote_connect_back`
46
+
# XDEBUG_MODE required for step debugging
47
+
XDEBUG_MODE: debug
48
+
# default port for Xdebug 3 is 9003
49
+
# idekey=VSCODE if you are debugging with VSCode
46
50
XDEBUG_CONFIG: >-
47
-
remote_enable=1
48
-
remote_host=host.docker.internal
49
-
remote_connect_back=1
50
-
remote_port=9000
51
-
idekey=PHPSTORM
51
+
client_host=host.docker.internal
52
+
idekey=PHPSTORM
52
53
# This should correspond to the server declared in PHPStorm `Preferences | Languages & Frameworks | PHP | Servers`
53
54
# Then PHPStorm will use the corresponding path mappings
54
55
PHP_IDE_CONFIG: serverName=api-platform
@@ -61,13 +62,34 @@ Note for Mac environments use the following:
61
62
remote_enable=1
62
63
remote_host=docker.for.mac.localhost
63
64
remote_connect_back=0
64
-
remote_port=9000
65
+
remote_port=9003
65
66
idekey=PHPSTORM
66
67
remote_autostart=1
67
68
remote_mode=req
68
69
remote_handler=dbgp
69
70
```
70
71
72
+
In VSCode, alongside the default PHP configuration in `launch.json`, you'll need path mappings for the Docker image.
73
+
```json
74
+
{
75
+
"version": "0.2.0",
76
+
"configurations": [
77
+
{
78
+
"name": "Listen for Xdebug",
79
+
"type": "php",
80
+
"request": "launch",
81
+
"port": 9003,
82
+
"log": true,
83
+
"pathMappings": {
84
+
"/srv/api": "${workspaceFolder}/api"
85
+
},
86
+
},
87
+
]
88
+
}
89
+
```
90
+
91
+
Note: For Linux environments, the `client_host` setting of `host.docker.internal` will not work, you will need the actual local IP address of your computer.
92
+
71
93
## Troubleshooting
72
94
73
95
Inspect the installation with the following command. The requested Xdebug
0 commit comments