Skip to content

02. Setting Up Xdebug on VSCode

Daniel Trolezi edited this page Sep 11, 2024 · 4 revisions

Xdebug is already installed and configured with develop, debug and coverage modes enabled by default. To enable VSCode integration follow the steps bellow:

  1. Install PHP Debug plugin: https://marketplace.visualstudio.com/items?itemName=xdebug.php-debug

  2. Click on "Run and Debug" tab on VSCode and add new configuration in launch.json file:

{
    "name": "Listen for Xdebug",
    "type": "php",
    "request": "launch",
    "port": 9003,
    "pathMappings": {
        "/var/www/laravel-app": "${workspaceRoot}"
    }
}
  1. Debug session will start by trigger.
    Add ?XDEBUG_TRIGGER in the query string of your request and start listening on VSCode by clickin on "Start Debbuging", or press F5.

  2. Additionaly, You can install Xdebug helper for Chrome instead of adding the trigger manually every time.

Relevant commits

References