Cheap and dirty debug 500 / WSOD errors


throw this in settings.php at the end. It registers a shutdown function that will print whatever the last error is. Not perfect but useful for rapid local development. I tend to throw this in my vagrant images on build to try and give an additional fallback

Get raw version
  1. function __the_end(){
  2. if(($err=error_get_last()))
  3. die('<pre>'.print_r($err,true).'</pre>');
  4. }
  5. register_shutdown_function('__the_end');