Drupal white screen of death

Thu, 01/19/2012 - 13:01
Submitted by admin

Every once in awhile, after enabling or disabling a module you will suddenly find yourself locked out of your website - only able to see a blank white screen.  Some people call this the Drupal White Screen of Death, I call it a huge hassle.

Now that I'm working in Drupal 7 with a lot of modules that are still in alpha/beta/dev this issue has happened a few times lately, so before you go running off to reinstall or restore your db from a backup, here is my quick fix that should get you back online:

  1. Open the /index.php file in your site directory and add this directly after the opening <?php tag:

    error_reporting(E_ALL);
    ini_set('display_errors', TRUE);
    ini_set('display_startup_errors', TRUE);

    This will make Drupal display errors for you, so you can get an idea of where the problem is.

    The last time I got the white screen of death, this was the error message:

    Fatal error: Class 'Profile2TypeUIController' not found in \sites\all\modules\entity\entity.module on line 937

    Basically, when I disabled the Profile2 module and cleared the caches - it didn't really clear all the caches and the entity module was having a wobbly because some function from Profile2 can no longer be found.
     

  2. Go into your database* and clear out (truncate) all your cache tables.  All the tables that begin with "cache_" and the "cache" table itself.

    * I always save a backup of my database before I do this, just in case I accidentally select an extra table or something unforeseen happens.