Skip to content

Instantly share code, notes, and snippets.

@GuySartorelli
Last active May 2, 2024 05:04
Show Gist options
  • Save GuySartorelli/2fd08bdb06cbd476f917bf86935aa420 to your computer and use it in GitHub Desktop.
Save GuySartorelli/2fd08bdb06cbd476f917bf86935aa420 to your computer and use it in GitHub Desktop.
Setting up xdebug for a DDEV project in vscode

Setting up xdebug for a DDEV project in vscode

This is based on the instructions at https://ddev.readthedocs.io/en/stable/users/debugging-profiling/step-debugging/#visual-studio-code-vs-code-debugging-setup If there's something in this gist that doesn't work, check the docs in case things have changed.

  1. Create a .vscode/ directory in your project root.
  2. Create a launch.json file inside that .vscode/ directory with the contents from https://ddev.readthedocs.io/en/stable/users/snippets/launch.json
  3. Create a tasks.json file inside that .vscode/ directory with the contents from https://ddev.readthedocs.io/en/stable/users/snippets/tasks.json

The .vscode/launch.json file tells vscode how to listen to xdebug, and also tells it to enable/disable xdebug for you. The .vscode/tasks.json file tells it how to enable/disable xdebug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment