Debugging PHP with Xdebug

There's a better way to debug PHP than var_dump.

By utilizing Xdebug’s ability to visualize the state of your application, step through its execution, and evaluate functions, you can debug like never before.

This series covers installing and configuring Xdebug for Trellis, MAMP, and Laravel Valet and configuring both PHPStorm and Visual Studio Code for use with Xdebug. We also dive in to each IDE’s features and how to best use them with Xdebug so you can debug like a champ!

132 minutes • 3808 MB • No DRM • H264, AAC, 1080p

Topics covered

  • Introduction and Demo
  • Installing and Configuring XDebug
    • Trellis
    • Valet
    • MAMP
    • Choosing a Debugger/IDE: PHPStorm, VS Code, Sublime Text, or Vim?
    • Initiating a Debugging Session
    • Debugging Request Lifecycle explained
    • Configuring your IDE
      • Visual Studio Code
      • PHPStorm
    • Common features across debuggers
    • Getting to know your Debugger
      • Visual Studio Code
      • PHPStorm
    • Debugging Request Lifecycle explained
    • Using Xdebug remotely
    • Improving Xdebug’s var_dump

Note: Sublime Text and Vim will not be covered in this series, for now. We dive more detail into why in the video Choosing a Debugger, but for now we’ll say I don’t think either solution is simple/usable enough to recommend pursuing at the moment. Feel free to dive into using either, though! If and when they are better, I will look into adding them back into the series.

Nice work on the videos. I’m a newbie to Xdebug and PhpStorm but found these tutorials very easy to follow and understand. They’re by far the best tutorials I’ve come across. I’m now setup and making good progress using them.

Andrew Stainer

Hey, well done Nathaniel! I’ve watched a few already. They’re clear and easy to follow. Have some 🍻 and a 🌮 🙂 I hope you consider doing some more videos on another topic...

Neil Gilmour

Join over 5,800 subscribers on our newsletter to get the latest Roots updates, along with occasional tips on building better WordPress sites.

Looking for WordPress plugin recommendations, the newest modern WordPress projects, and general web development tips and articles?

“Easily the best WordPress email I get.” Colin OBrien

Follow us on Twitter @rootswp

Ready to checkout?