I keep digging up this same information from some obscure sources, so I thought I would post it here. Now if you have not set up XDebug with a project locally, I highly recommend that, but still, nothing beats a good stack trace. In Drupal 7, I would drop this into settings.php to show errors, regardless of the site settings:
What's more, starting in 7.33, we got access to this option:
error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); $conf['error_level'] = ERROR_REPORTING_DISPLAY_ALL;
Adding this to your settings.php (or similar included file), would enable HTML comments to be added directly within the markup of your code.
$conf['theme_debug'] = true;
<!-- THEME DEBUG --> <!-- CALL: theme('html') --> <!-- FILE NAME SUGGESTIONS: * html--front.tpl.php * html--home.tpl.php x html.tpl.php --> <!-- BEGIN OUTPUT from 'sites/all/themes/my_module/templates/html.tpl.php' --> ... All of the markup... <!-- END OUTPUT from 'sites/all/themes/my_module/templates/html.tpl.php' -->
With this new configuration system in Drupal 8, this is now as follows:
Drupal 8 also has a theme_debug option so to speak, just add this to sites/default/services.yml.
error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE); $config['system.logging']['error_level'] = 'verbose';
Be careful though, as these theme debug options can break your markup in some unsuspecting places. Also, be sure not to commit it!
parameters: twig.config: debug: true