No Errors with Errors turned ON

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?


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)


您还需要确保已启用display_errors。

ini_set( 'display_errors', 'on' );

WSOD的完整文档。

链接地址: http://www.djcxy.com/p/69184.html

上一篇: 调试Drupal的死亡白屏?

下一篇: 错误打开时没有错误