Why I'm not able to debug twig templates? sites/default/files/php directory is empty As in question. I'm following this tutorial: https://dev.acquia.com/blog/debugging-drupal-8/debugging-twig-templates-in-drupal-8-with-phpstorm-and-xdebug/25/08/2016/16586

but directory 


  sites/default/files/php/twig


is always empty

I'v tried cr all, checked file system page, did drush cron, checked theme page - no errors.

I got some errors related to permissions at theme settings page, but:


  chmod 777 -R sites/default/files


seems to solved those.

Any advices?
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