CodeIgniter Forums
Error Question - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Error Question (/thread-7749.html)



Error Question - El Forum - 04-21-2008

[eluser]louis w[/eluser]
I noticed that not all PHP errors are getting returned to the browser (and logs).

If my php is broken, such as if i declare a class incorrectly with a missing training } it will not return it to the error log or on page error. Is there a way to see syntax errors as well? It would be very helpful if CI would return all the errors like native php error messages.


Error Question - El Forum - 04-21-2008

[eluser]Seppo[/eluser]
Some PHP errors, like parse errors, can not be cached by CI. Take a look at http://www.php.net/manual/en/function.set-error-handler.php

Quote:The following error types cannot be handled with a user defined function: E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, E_COMPILE_WARNING, and most of E_STRICT raised in the file where set_error_handler() is called.

It should show you the error in the page load, if display errors is on, and acording to the error reporting level.


Error Question - El Forum - 04-22-2008

[eluser]louis w[/eluser]
My index file contains error_reporting(E_ALL); Should this display parse errors on page when CI can't? Do I need something else?


Error Question - El Forum - 04-22-2008

[eluser]Seppo[/eluser]
display_errors should be on
Code:
ini_set('display_errors', 'On');
That line should be in a successfully parsed file, if it's on a file with parse error it will die before executing it.


Error Question - El Forum - 04-22-2008

[eluser]louis w[/eluser]
Thanks Seppo, I see the errors now.