Industrial Industrial - 2 years ago 93
PHP Question

White screen of death!

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.


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!

Why does Code Igniter give me a white page?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download