Drupal - How to see the error messages when I get the white screen of death?
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);
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:
error_reporting(E_ALL); 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') { error_reporting(E_ALL); 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);
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