How do I debug a PHP WSOD?

Very occasionally I get a mystifying white-screen-of-death PHP error - nothing is displayed or logged, even with the following settings:

ini_set("error_reporting",E_ALL);
ini_set("display_errors",true);
ini_set("log_errors",true);
ini_set("display_startup_errors",true);
ini_set("html_errors",false);
ini_set("error_log","/var/log/php_error_log");

I read somewhere that output buffering or memory limit errors can result in no error output, but previously (for example) I have found a WSOD simply caused by __autoload() looking for a missing class file.

Has anyone found a way to get these errors visible? I hate commenting out blocks of code.

Thanks


I had a similar problem recently and it turned out that the software package I was using was overriding the logging settings so that I was never seeing the logs in certain situations. Because your putting the settings in the ini file, i'm guessing your using php.ini, there is a lot of opportunity that something closer to where the code is run is changing the settings.

My advice would be to put error_reporting(E_ALL | E_STRICT); in the file that is causing the problem and see if that improves things.

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

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

下一篇: 我如何调试PHP WSOD?