• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Maddening Lack of Error Reporting - White Screen

#1
[eluser]ladyj001[/eluser]
I'm sure this is a rookie setup/config mistake...But, I am having a devil of a time getting CI to display coding errors that occur in the controller and/or view. Instead of error messages, I get a blank screen.


For example, in the controller I called an model method that did not exist. Rather than an error, I got the blank screen.

Another time, I invoked a view that was using form helper functions; but, I forgot to load the helper. Again, no error message on screen or in log. Just a blank screen.

So it is completely maddening not to have to debug by trial an error - literally commenting out one line at a time until I find the culprit.

I have $config['log_threshold'] = 4 - but in the cases above, no errors were written to the log. I have $this->output->enable_profiler(TRUE) is my controller, but no errors show up on the screen.

Any help would be greatly appreciated.

#2
[eluser]Huan[/eluser]
Have you tried to edit index.php:

error_reporting(E_ALL);

if it was "0" instead of "E_ALL" the screen will go blank

#3
[eluser]ladyj001[/eluser]
Thanks for the response. Yes it is already set to E_ALL. But still not all errors are displayed on the screen.

A workaround is that apache logs all PHP errors; so, I am able to diagnosis problems by checking the apache log files. But, it would be nice if all errors were displayed consistently on the screen.

#4
[eluser]Pascal Kriete[/eluser]
Turn display_errors on in your php.ini to get all errors system-wide, including syntax errors. Or you can do it on a 'per application' basis by putting the following into your index.php file:
Code:
ini_set('display_errors', 1);

Welcome to CodeIgniter.

#5
[eluser]ladyj001[/eluser]
Thanks. But display_errors is already on in my php.ini file.

#6
[eluser]jjpmann[/eluser]
not sure if you have found the answer but did you check to see if your 'logs' directory is writable

#7
[eluser]Michael Wales[/eluser]
Code:
error_report(E_ALL|E_STRICT);

Usually a white-screen means there is white-space where they shouldn't be. Make sure you aren't using PHP's closing tag.

#8
[eluser]johnwbaxter[/eluser]
[quote author="Michael Wales" date="1228187637"]
Code:
error_report(E_ALL|E_STRICT);

Usually a white-screen means there is white-space where they shouldn't be. Make sure you aren't using PHP's closing tag.[/quote]

I know this is an old thread but it needs pointing out, that code should be:

Code:
error_reporting(E_ALL|E_STRICT);
not
Code:
error_report(E_ALL|E_STRICT);


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.