Skip to content
David Laing edited this page May 6, 2013 · 5 revisions

You WordPress Development Flow dev VM includes to-debug - a browser based PHP debugger. This allows you to set breakpoints and step through your running PHP code line by line to debug tricky problems - a far more efficient way to diagnose errors than var_dump() / print_r().

To use the debugger:

  1. Start up your dev server as per normal, stopping just before the final rake run step
  2. Run rake debug instead
  3. Set a breakpoint in your plugin code by adding a xdebug_break(); call at line you want the debugger to stop at.
  4. Now open http://localhost:4567 in Chrome

Debugging only works with Chrome

  1. Navigate to the page where you want to start the debugger.
  2. Click the Launch debugger link at the bottom of the page.
  3. A new ti-debug tab will open; which attempt to open a popup window. If this is blocked by your browser's popup blocker; be sure to allow popups from localhost and manually open the popup.
  4. The popup contains the debugger, which you should recognise as very similar to Chrome's Javascript debugger. Hit Play to advance to your xdebug_break(); breakpoint.
  5. Debug away - inspect variables, advance line by line etc.
  6. When done, close the debug popup window.
  7. Refreshing your http://localhost:4567 window will cause another debug window to pop open. To stop this behaviour, close the ti-debug tab

This screencast shows the process in action:

Clone this wiki locally