Skip to content

Commit dfb5ef6

Browse files
authored
Update debugging.md (#1323)
1 parent b920ea9 commit dfb5ef6

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

distribution/debugging.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ services:
4343
# See https://docs.docker.com/docker-for-mac/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host
4444
# See https://github.com/docker/for-linux/issues/264
4545
# 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
4650
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
5253
# This should correspond to the server declared in PHPStorm `Preferences | Languages & Frameworks | PHP | Servers`
5354
# Then PHPStorm will use the corresponding path mappings
5455
PHP_IDE_CONFIG: serverName=api-platform
@@ -61,13 +62,34 @@ Note for Mac environments use the following:
6162
remote_enable=1
6263
remote_host=docker.for.mac.localhost
6364
remote_connect_back=0
64-
remote_port=9000
65+
remote_port=9003
6566
idekey=PHPSTORM
6667
remote_autostart=1
6768
remote_mode=req
6869
remote_handler=dbgp
6970
```
7071
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+
7193
## Troubleshooting
7294

7395
Inspect the installation with the following command. The requested Xdebug

0 commit comments

Comments
 (0)