Drupal: WSOD

I've been trolling the boards a lot this week, looking for help on various road blocks. One issue I've seen a TON of is people running up against the the brick wall of the dreaded WSOD (White Screen of Death). This is when something breaks your Drupal site and the only feedback you get on the error is a blank white screen full of absolutely nothing. It can be pretty frustrating, but you need to know that there is a simple fix.

Drupal code is pretty tough to back trace. With the hook system, module A can be invoking module B by calling a function in module C. Add to this innumerable includes (i.e. JQuery) and wrappers (i.e Themes), and you had a mightly slim chance of finding a missing semi-colon by the use of your wits alone.

So turn on error checking.

Seriously - it's a PHP setting that is turned off by default on most web servers. Turn it back on in your development environment by adding this snippet to your index.php file.


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

// $Id: index.php ...

Just slip it in at the top, just below the PHP tag. You'll immediately begin getting useful errors, usually specific to the module and line number. Trust me - it makes a world of difference.