Skip to content

Debugging ​

Step debugging with Xdebug 3: breakpoints, variables, watches and inline values in the editor.

Set up ​

  1. Install Xdebug for the PHP you run (php -v lists it when it's loaded).
  2. In Settings ▸ PHP, choose the interpreter. For Docker, Docker Compose or SSH, set the path mappings between your project and where the code runs.
  3. Settings ▸ PHP ▸ Debug has the port (9003 by default), Break at first line, exceptions to stop on, and how many children of an array or object to load.

Debug ​

  • A script: the top bar's 🐞 debugs the open PHP file.
  • A test: Debug in the Run menu or a test's gutter menu.
  • A web request: turn on Start Listening for PHP Debug Connections (the top bar's button beside 🐞 in the Classic layout, or Run in the main menu), then load the page with Xdebug's trigger (a browser extension or XDEBUG_TRIGGER).

Breakpoints: click the gutter, or Ctrl+F8.

ToPress
ResumeF9
Step over / into / outF8 / F7 / Shift+F8
Run to cursorAlt+F9
StopCtrl+F2

The Debug tool window has the frames, variables and watches; the values of variables also show in the editor beside the lines that set them.

Released under the Apache License 2.0. PHPBlitz is an independent project.