Why I'm not able to debug twig templates? sites/default/files/php directory is empty
Probably the directory sites/default/files/php/twig is empty because the container parameter twig.config.cache is set to false.

The approach used in the linked article is arguable.. put a breakpoint in every twig compiled template is not a viable solution. For debugging twig templates with xdebug there are better alternatives:


use the devel module + this patch (Committed)
use the twig_xdebug module