lower the error reporting level in php.ini

hello,
how can I lower the error reporting level in php.ini?
SabrinAsked:
Who is Participating?
 
ellandrdConnect With a Mentor Commented:
You don't need to change the error reporting in php.ini, you can do it on a script by script basis, which is neat for debugging only certain areas of code. for example:

<?php
// Turn off all error reporting
error_reporting(0);

// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);

// Report all PHP errors (bitwise 63 may be used in PHP 3)
error_reporting(E_ALL);

?>
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
full technical article:
http://php.net/error_reporting
0
 
SabrinAuthor Commented:
I dont want to get technical thats why im asking here!
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
but changing the setting in the php.ini IS technical.
the doc tells you want value to set to get a certain behaviour.
the doc also tells you that you can change the behaviour at run time using error_reporting() function.

there are also other settings that can influence error display:
http://php.net/manual/de/ref.errorfunc.php#errorfunc.constants

setting the error level to 0 will show no errors at all
0
 
SabrinAuthor Commented:
what If I have this (error_reporting  =  E_ALL) in php.ini
and this (LogLevel   crit) in httpd.conf

will I see any errors in the browser ?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you will see all php errors, but only critical apache errors
0
 
hernst42Commented:
If you see errors in the rowser depends on the php.ini setting display_errors. If its on all errors that match error_reporting are printed to screen. If display_errors is off no error (even fatal errors) will be displayed
0
 
ellandrdCommented:
thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.