Skip to content

Commit 5a97367

Browse files
Ziumperdunglas
authored andcommitted
docs: add xdebug configuration for VSCode
1 parent adaa1f2 commit 5a97367

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/xdebug.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,27 @@ You can now use the debugger!
4646
XDEBUG_SESSION=1 PHP_IDE_CONFIG="serverName=symfony" php bin/console ...
4747
```
4848

49+
## Debugging with Xdebug and VScode
50+
51+
1. Install necessery [PHP extension for VScode](https://marketplace.visualstudio.com/items?itemName=DEVSENSE.phptools-vscode).
52+
2. Add [debug configuration](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations) into your `.vscode\launch.json` file.
53+
54+
Example:
55+
56+
```
57+
{
58+
"name": "Listen for Xdebug",
59+
"type": "php",
60+
"request": "launch",
61+
"port": 9003,
62+
"pathMappings": {
63+
"/app": "${workspaceFolder}"
64+
}
65+
}
66+
```
67+
68+
3. Use [Run and Debug](https://code.visualstudio.com/docs/editor/debugging) options and run `Listen for Xdebug` command to listen for upcomming connections with [the **Xdebug extension**](https://xdebug.org/docs/step_debug#browser-extensions) installed and active.
69+
4970
## Troubleshooting
5071

5172
Inspect the installation with the following command. The Xdebug version should be displayed.

0 commit comments

Comments
 (0)