白屏死亡! [英] White screen of death!

查看:137
本文介绍了白屏死亡!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

调试一个安装在新开发环境中的codeigniter应用程序后,当我看到白屏,没有什么可用的时候,我开始害怕。



PHP 我已经能够解决每一个导致这个问题的错误, error_reporting(E_ALL)& display_errors,1 也设置了,我甚至安装Xdebug希望得到更多的输出,但没有。我的日志设置也工作,但没有写入日志。



有没有办法得到一些信息印刷出来,而不是一个完整的白色屏幕?这肯定会缩短我的时间花在解决导致这种情况的最终错误? / p>

非常感谢。



参考:
为什么代码Igniter给我一个白页?

解决方案

我发现,从我的问题的时间,似乎没有什么似乎确保错误总是输出与PHP,似乎抛出白色的屏幕在这里和那里。不管PHP的ini设置。



我发现,最好的解决方法是使用以下行,以确保错误日志记录被放入一个文件容易访问并由应用程序监视:

  ini_set('error_log',MYPATH .'logs / errorlog.log'); 

至于我测试它,当白色屏幕出现 - 它也会记录到这个错误日志。似乎是最容易的方法来知道当错误发生时会发生什么。


After debugging a codeigniter app that were installed into a new development environment, I have started to freak out when seeing white screens with nothing more available. I have been able to solve each and every one of the errors that have caused this, but it have taken seriously way too long time.

PHP error_reporting(E_ALL) & display_errors", 1 is set as well. I even installed Xdebug in hope of getting more output, but no. My logging settings are also working, but nothing is written to the log.

Is there a way to get something informative printed out instead of a complete white screen? It would certainly shorten my time spent on solving the eventual errors that causes this?

Thanks a lot!

Reference: Why does Code Igniter give me a white page?

解决方案

I've found out, since the time of my question, that nothing seems to ensure that errors are always outputted with PHP, which seems to throw white screens here and there. Regardless of PHP's ini-settings.

I've found out that the best workaround however is to use the following line to ensure that error logging is put into a file easily accessed and monitoredby the application:

ini_set('error_log', MYPATH .'logs/errorlog.log'); 

As far as I've tested it, when white screens appear - it also gets logged into this errorlog. Seems to be the easiest way to know what happens when things go wrong.

这篇关于白屏死亡!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆