Monday, February 23, 2009

How do I stop Drupal from displaying a blank white screen?

How do I stop Drupal from displaying a blank white screen?

Module configuration

When you receive a blank white screen there are a couple of things that may be going on. Review the following issues below.
Memory Limit

When you're setting up a site with a large module set like Ubercart, you may run into the issue where your Drupal site becomes non-responsive and instead displays a blank white screen (also know as the White Screen of Death). This is most commonly due to the amount of memory required to run a site using so much code. While some major memory issues will be fixed in Drupal 6, for users of Drupal 5 you should try one of the following solutions.

* Add memory_limit = 32M to your php.ini file (recommended, if you have access)
* Add ini_set('memory_limit', '32M'); in your site's settings.php file
* Add php_value memory_limit 32M in your .htaccess file in the Drupal root

Depending on your site host, one or more of these options may not be available to you. Try them to see what works, and if you still can't solve the problem talk with your host about them increasing the limit for you.

These solutions and more information available here.
Error Reporting

If adjusting the memory limit isn't the culprit, another issue is that PHP could be failing somewhere, but not reporting the error to the screen. Inserting the following lines into the Drupal's index.php should set PHP to report all errors.

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

After inserting the code, load the same page that caused the same error in the first place. If any PHP errors are causing the page to load they should be displayed on the screen. From there the PHP error might give you a better indication of what's causing Drupal to fail.

No comments: