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.