LocalByFlywheel + XDebug + VSCode

I’m going to be recording a video showing how to use the add-on, but here’s the basic steps.

SETUP

  1. Install the add-on
  2. Enable the add-on & Relaunch Local
  3. Go to the site you want to debug in Local
  4. Start the site
  5. Click on the Utilities tab
  6. Click the “Add Run Configuration to VS Code” link - this will create an xdebug/vscode configuration file inside the app/public folder

Debugging

  1. Open the app/public folder in vscode
  2. Start debugging (command/control + shift + p and then type “debug” then click “Debug: Start Debugging”
  3. Load the site in your browser

Note: By default the debugger will only activate on errors, but you can add breakpoints to specific code by clicking to the left of the line numbers in the editor before starting the debugging session.

I hope that helps!

1 Like