What are the error reporting levels in PHP? Any PHP error like a simple syntax error causes error 500 and I get no useful info on the php error, can that be changed?
What are the error reporting levels in PHP? Any PHP error like a simple syntax error causes error 500 and I get no useful info on the php error, can that be changed?
In PHP, the error reporting level (whether errors go to the log or to the screen or whatever) is determinded by the error_reporting INI directive (or at runtime using the error_reporting() function). Both take an integer as their value - and usually this integer is represented by error level constants like E_ALL, E_STRICT or E_USER_WARNING.
So in order to set the error reporting to anything but notices and strict errors, you would set something like this in php.ini:
Code:
- error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
Here is a table of different error levels, all linking back to PHP.net
error_reporting() level constants and bit values
If you want to hide errors on a PHP page or just show really critical ones, you can try this,
PS. You first need to make sure your browser didn't display friendly error.Code:// Report all PHP errors error_reporting(E_ALL);
Hey Zecho, that was a great work. I was searching for such a list of PHP error reporting. And I have checked that my browser is not giving any friendly error. Thank you and all others for giving valuable inputs.
Bookmarks