Welcome Guest, Not a member yet? Register   Sign In
display_errors
#1

[eluser]Unknown[/eluser]
I have some strange behavior in my CI site. These are my settings:

- php.ini: error_reporting = E_ALL, display_errors = off
- CI: error_reporting=E_ALL, display_errors=off (index.php)
- log_treshold=1

My idea is to log all the php errors,warnings, etc to the apache logs like I'm doing in other sites and not display these errors to the users. Also I want CI errors to be logged in a different log file.

Problem is that with these settings, any warning or notice is displayed on the site and not in the apache log. When I change error_reporting in CI (index.php) to 0, no warnings are displayed neither logged (which is ok). I look for any setting related to display_errors in the code, there is none. Also I check in the page if display_errors is for any reason set to 1, but no is set to 0.

I test with a single php file outside CI but in the same server and it works ok: doesn't display errors on the site, and all errors, warnings and notices went to apache error log.

Could you help me to figure out why I'm having this behavior? Why the warning and notices keep it displaying in the site?

Thanks
#2

[eluser]Unknown[/eluser]
Just ran across this myself. CI appears to set up it's own exception handlers to trap errors and calls show_php_error() in $CI/libraries/Exceptions.php. This is a simple
echo output so the stuff show up in your page output. I'm a CI newbie so if there is a way to change this behavior, I'd like to know too.
#3

[eluser]mohrt[/eluser]
I just came across this myself. It would be good if show_php_error() respected the display_errors setting of PHP. ie. don't echo errors if display_errors is off.
#4

[eluser]InsiteFX[/eluser]
You can extend the Excertions Class to do what you want!

InsiteFX
#5

[eluser]mohrt[/eluser]
Well yes, but that isn't really the point. Why would you want code igniter spitting php errors to the screen if display_errors is disabled? It's about default, expected behavior of the framework.
#6

[eluser]Eric Barnes[/eluser]
I agree too. This should be set internally and not have to override the exceptions class.
#7

[eluser]InsiteFX[/eluser]
Maybe add it to the Reactor Eric?

InsiteFX
#8

[eluser]Eric Barnes[/eluser]
[quote author="InsiteFX" date="1295465300"]Maybe add it to the Reactor Eric?

InsiteFX[/quote]

Yea I created a feature request for it so this doesn't get forgotten: http://codeigniter.uservoice.com/forums/...errors-set
#9

[eluser]InsiteFX[/eluser]
Thanks Eric.

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB