Skip to content

Trellis + Xdebug + PhpStorm

I love running Xdebug through PhpStorm’s built in debugger but have had the hardest time getting it to work with Trellis. I have no problem getting it going with VVV but have never been able to get my path mappings correct in Trellis.

Well, turns out it’s really simple with PhpStorm’s Zero-Configuration debugging. Here’s the JetBrains documentation on that – but the short of it is:

  • Install a bookmarklet or browser extension. I use The easiest Xdebug on Firefox, and Xdebug Helper on Chrome.
  • On your browser extension, set the IDE key to XDEBUG
  • Set a breakpoint somewhere
  • Tell PhpStorm to start listening for connections
  • Start the debugger on your browser and refresh the page

The first time you run the debugger PhpStorm will pop up a window showing the path mappings it has detected. These are fine to select as defaults.

Also, I’ve found that eventually the browser will time out, however this does not seem to effect the debugger as I’m still able to step through code and use the debugger normally. So, I’ve been able to live with that.

Links –

3 responses to “Trellis + Xdebug + PhpStorm

  1. Hey, do you mind sharing how your project is set up in phpstorm. I can’t seem to be able to get this working.

    1. Hi Ziga,

      I hope you were able to get this sorted out. I’m not sure if you saw it, but I posted a fairly detailed response here, in your thread on the Roots Discourse.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.