Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I see the error messages when the site I am working on gets a white screen?

share|improve this question
up vote 24 down vote accepted

Put this at the bottom of settings.php:

error_reporting(-1);  // Have PHP complain about absolutely everything 
$conf['error_level'] = 2;  // Show all messages on your screen, 2 = ERROR_REPORTING_DISPLAY_ALL.
ini_set('display_errors', TRUE);  // These lines just give you content on WSOD pages.
ini_set('display_startup_errors', TRUE);
share|improve this answer
This is great for development sites though I prefer /var/log/apache2/error.log for live sites. This works though. :) – Citricguy Feb 3 '12 at 5:25

The White Screen of Death (Completely Blank Page) resource on drupal.org will step you through the steps to see the error message as well as common problems that cause them.

"Invisible" Errors

If error reporting is turned off, you could be getting a fatal error but not seeing it. On a production site, it is common to have error reporting turned off. If that is the case and PHP has hit an unrecoverable error, neither an error nor content will be displayed, therefore you end up with a completely blank page.

What you can do about this is either turn on PHP error reporting so it displays a message on the page itself, or check your log files (from the server) to look for the error. How to do both of these are explained below.

Enable Error Reporting

Although it may be turned off on commercial hosts and production sites (for good reason, so that users do not see the errors), these errors are one of your best tools for troubleshooting. To enable error reporting, temporarily edit your index.php file (normally located in your root directory) directly after the first opening PHP tag (do not edit the actual file info!) to add the following:

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

You will now be able to see any errors that are occurring directly on the screen. Memory problems may still not be displayed, but it's the first step in a process of elimination.

If you are using a multi-site setup and only want errors to appear for one site, then check the name of the host first as in:

if ($_SERVER['HTTP_HOST']==='some.domain.name.here') {
  ini_set('display_errors', TRUE);
  ini_set('display_startup_errors', TRUE);

If the problem occurs while running update.php open update.php in a text editor and uncomment the following line:

ini_set('display_errors', FALSE);
share|improve this answer

Have a look at Apache error log, in Ubuntu it's located in /var/log/apache2/error.log so you can do:

tail -f /var/log/apache2/error.log
share|improve this answer
sudo tail -f /var/log/apache2/error.log – Citricguy Feb 3 '12 at 5:23

I found easy way of tracking down the WSOD errors by running the whole site via drush, e.g.:

drush rs

After that access the site at the given new address (e.g., then try to reproduce the problem, and you'll see all errors on the terminal screen. No need to reconfiguring your PHP, especially in cases when display_errors fails (e.g. MAMP).

Other tricky way I've found it by using debuggers, e.g.:

  • OS X:

    sudo dtruss -fn httpd 2>&1 | grep -i error
  • Linux:

    sudo strace -f $(pgrep -fn httpd) 2>&1 | grep -i error

    Note: Change httpd into php if you're using drush rs as above.

Or installing XDebug PHP extension and generate a trace file (xdebug.auto_trace=1).

share|improve this answer

If you are using drush, you can see error messages using drush-ws command.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.