CodeIgniter Forums

Full Version: Error Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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.

El Forum

[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.se...andler.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.

El Forum

[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?

El Forum

[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.

El Forum

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