I am trying to debug a broken page in a Drupal application and am having a hard time getting PHP to spit anything useful out. I have the following set:

error_reporting = E_ALL
display_errors = On
display_startup_errors = On
log_errors = On
error_log = /var/log/php/php_error.log

I have a file showing me phpinfo() which confirms these variables are set correctly for the environment. I have increased memory_limit to 256M (which should be more than enough). Yet, the only indication I get is a status 500 code in the apache access log and a blank white page from PHP.

The Apache virtual host has LogLevel set to debug and the error log only outputs:

[Sat Jun 16 20:03:03 2012] [debug] mod_deflate.c(615): [client] Zlib: Compressed 0 to 2 : URL /index.php, referer: http://ec2-174-129-192-237.compute-1.amazonaws.com/admin/reports/updates
[Sat Jun 16 20:03:03 2012] [error] [client] File does not exist: /var/www/favicon.ico
[Sat Jun 16 20:03:03 2012] [debug] mod_deflate.c(615): [client] Zlib: Compressed 42 to 44 : URL /favicon.ico

The PHP error log outputs nothing at all. kernel and syslog show nothing related to Apache or PHP. I have also tried installing suphp and checking its log just confirms the user is executing correctly:

[Sat Jun 16 20:02:59 2012] [info] Executing "/var/www/index.php" as UID 1000, GID 1000
[Sat Jun 16 20:05:03 2012] [info] Executing "/var/www/index.php" as UID 1000, GID 1000

This is on Ubuntu 12.04 x86_64 with the following PHP modules:

ii  php5                             5.3.10-1ubuntu3.1          server-side, HTML-embedded scripting language (metapackage)
ii  php5-cgi                         5.3.10-1ubuntu3.1          server-side, HTML-embedded scripting language (CGI binary)
ii  php5-cli                         5.3.10-1ubuntu3.1          command-line interpreter for the php5 scripting language
ii  php5-common                      5.3.10-1ubuntu3.1          Common files for packages built from the php5 source
ii  php5-curl                        5.3.10-1ubuntu3.1          CURL module for php5
ii  php5-gd                          5.3.10-1ubuntu3.1          GD module for php5
ii  php5-mysql                       5.3.10-1ubuntu3.1          MySQL module for php5

So, what am I missing here? Why no error reporting?

  • It's possible that PHP is segfaulting before it gets a chance to startup properly. Can you try running php -m at a terminal (if you have a module loading twice, this might segfault)? If that works try php index.php while in the folder of your Drupal installation and let us know what happens. – Jay Jun 16 '12 at 22:39

Drupal itself changes the error reporting and display settings which happens after the ini file (where your settings reside) is processed. To change the settings after drupal does you can add

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

to index.php.

Drupal is complex. The blank white page is affectionately known as the "white screen of death" (WSOD) in the Drupal community. See http://drupal.org/node/158043 for more troubleshooting help.

  • While this did work for other pages, ultimately my problem was that I had a mix of 500 and 200 code WSODs. The particular one in this case actually was giving back a HTTP 200 OK so it proved to be very difficult to debug. I eventually narrowed it down to the media_mover module submodule mm_s3. I resorted to disabling modules in batches for process of elimination. – Andy Shinn Jun 21 '12 at 1:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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