Setting up PhpStorm + Xdebug with Trellis [walkthrough]

I had been having a hard time getting Xdebug going in Trellis with PhpStorm’s debugger. It was easy to get setup in VVV but I could never get the path mappings right in Trellis. Turns out it’s super easy with PhpStorm’s Zero-Configuration Debugging.

I did a quick screen cast if anyone is interested:

…but the short of it is:

  1. Install one of the JetBrains bookmarklets, or use a browser extension like this one for Firefox, or this one for Chrome, or whatever.
  2. Give your extension the IDE key XDEBUG
  3. Set a breakpoint and tell PhpStorm to start listening for connections
  4. Refresh your browser and accept the default mappings that PhpStorm detects

I’m digging the Roots stack but was really missing my debugger as it’s helped me to learn a ton. It’s great to have it back.

Hope this is helpful to someone.

:slight_smile:

9 Likes

So no changes were actually needed on the Trellis/VM side of things right? Just want to make sure there’s nothing we’re missing to make this easier.

Nope, no changes on the VM side at all. I don’t think it could possibly be easier.

:smile:

Thanks for this! No more var dumps!

2 Likes

If using a self-signed ssl certificate just like the one Trellis provides you must uncheck the following option in Phpstorm, @smutek great walkthrough :slight_smile:

2 Likes