Page 1 of 1

error_reporting being set to 0

Posted: Fri Oct 06, 2006 7:03 pm
by Ollie Saunders
Somewhere, somehow in my code error_reporting is being set to 0 when it shouldn't be. I've done searches for any ini_sets and calls to error_reporting and I can't find a single place where it could possibly be set to 0. Does anybody have any idea what might set error_reporting to 0 as a side-effect or how I could find out the point at which error_reporting is changed?

Posted: Fri Oct 06, 2006 7:19 pm
by volka
You may try

Code: Select all

; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
disable_functions = error_reporting,ini_set
in your php.ini
You'll get something like Warning: error_reporting() has been disabled for security reasons in file:line
phpinfo() shows a value != 0 for both global and local settings?

Posted: Fri Oct 06, 2006 7:48 pm
by Ollie Saunders
Thanks for your help volka. Don't worry for now, I'm not sure was is going on here.
For now things are working.

Posted: Fri Oct 06, 2006 8:05 pm
by Ollie Saunders
Ahhh Ha!

Code: Select all

if (!@include $fileToLoad) {
Results in that file starting with error_reporting set to 0.

Which begs another question what is the best way of checking if a file can be included or not?

Posted: Fri Oct 06, 2006 10:31 pm
by RobertGonzalez
file_exists(). I think there was a post around here at one point that brought up the fact that if you use error suppression on an include it acts as a global error suppressor for the entire file (or something to that effect).

Posted: Sat Oct 07, 2006 4:34 am
by Ollie Saunders
Hehe, you know what Everah, I think that was my post.
But I didn't realise that error supression set error_reporting, I thought it was some other hidden value.

I don't see anything in the manual that say file_exists() checks the include paths.

Posted: Sat Oct 07, 2006 10:39 am
by RobertGonzalez
ole wrote:I don't see anything in the manual that say file_exists() checks the include paths.
Sorry, I think I misunderstood you on that one. I am not sure if there is anything that checks include paths.