2026 Community Survey results are here! See how the Craft CMS community works. results are live!

Debugging Twig Templates in PhpStorm and Xdebug

A short demonstration on how to set Xdebug breakpoints in Twig files using Xdebug and PhpStorm.

Up to this point we’ve only been work­ing in PHP, debug­ging the PHP code for the Bug­gy plu­g­in. If you fol­lowed along with the oth­er videos then you were able to suc­cess­ful­ly remove the bugs in the plu­g­in and from the con­trol panel.

How­ev­er, with Php­Storm, we can also debug Twig tem­plates. Php­Storm added tem­plate lan­guage debug­ging for Twig and Blade in 2019. It’s a nice bonus when using Php­Storm and build­ing sites in Craft CMS.

Craft Version
Craft 4, Craft 5
Instructor
Level
Intermediate
Date Published
January 10, 2026