Reputation:
I have all errors turned on (error_reporting(-1)) in Drupal, but for some reason most errors do not come through in the logs or on screen. I can replicate the problem by simply changing a function name to something else, and I would expect to see a function doesn't exist error, but I just get a white screen. I have tried replicating this outside of the Drupal framework and I can't - so it leads me to believe it isn't my setup of PHP (Zend Server/Apache2/PHP/Windows) but is in Drupal somewhere...
Any ideas anyone?
Upvotes: 3
Views: 9229
Reputation: 3319
I know this may be late, but it helped me. Most times a module causes WSOD, I couldn't just disable modules to test which it was, since I may have lost data in the process. What I did was to edit this function in module.inc
function module_invoke_all($hook) {
$args = func_get_args();
// Remove $hook from the arguments.
unset($args[0]);
$return = array();
foreach (module_implements($hook) as $module) {
print "Starting loading $module <br />";
$function = $module . '_' . $hook;
if (function_exists($function)) {
$result = call_user_func_array($function, $args);
if (isset($result) && is_array($result)) {
$return = array_merge_recursive($return, $result);
}
elseif (isset($result)) {
$return[] = $result;
}
}
print "Finished loading $module <br />";
}
return $return;
}
And I added those 2 print statements in the code above, then refresh the page, the module which didn't reach the "Finish loading $module" statement is the one with the problem... it was devel in my case.
After finding the module, you can go into the system table and look for that module, set it's status = 0 and bootstrap = 0 or run the query:
UPDATE system SET status = 0, bootstrap = 0 WHERE name = 'module_name' LIMIT 1
Reference: Debugging Drupal White Screen of Death (WSOD)
Upvotes: 3
Reputation: 532
I note your question has already been answered but it may be useful for others reading this to know that sometimes a WSOD can be caused by an older incompatible version of PHP on the server. Drupal 7 requires PHP 5.3 but many servers are still running PHP 5.2. This can cause a WSOD with no error messages.
Upvotes: 0
Reputation:
I started to enable/disable modules to see when I could see errors again and limited it to two modules that turned off the error handling... After more investigation I found that in a nusoap.php class error reporting had been turned off because certain errors kept showing (some other developer had turned it off)... Turned it back on, upgraded nusoap.php and now all is working... Thanks for the help all
Upvotes: 0
Reputation: 3632
Sometimes, I would get strange errors including WSOD if i included a file that had the closing php token.
?>
It took me forever to track down.
Upvotes: 0
Reputation: 542
Check php's setting for "error_reporting", maybe? Mine's set to:
error_reporting = E_ALL & ~E_DEPRECATED
Upvotes: 0
Reputation: 11
this might be the dumbest answer on stackoverflow, but this happened to me when i was desiging a cakephp site from scratch and had white background and white font in the css, and couldn't get anything, no errors or sql dump.
see if you can select text on the screen.
Upvotes: 1
Reputation: 105914
You need to make sure display_errors is enabled as well.
ini_set( 'display_errors', 'on' );
Upvotes: 3