Skip to content

Commit

Permalink
docs: add xdebug configuration for VSCode
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziumper authored and dunglas committed Dec 19, 2024
1 parent adaa1f2 commit 5a97367
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/xdebug.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@ You can now use the debugger!
XDEBUG_SESSION=1 PHP_IDE_CONFIG="serverName=symfony" php bin/console ...
```

## Debugging with Xdebug and VScode

1. Install necessery [PHP extension for VScode](https://marketplace.visualstudio.com/items?itemName=DEVSENSE.phptools-vscode).
2. Add [debug configuration](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations) into your `.vscode\launch.json` file.

Example:
```
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/app": "${workspaceFolder}"
}
}
```
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.

## Troubleshooting

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

0 comments on commit 5a97367

Please sign in to comment.