PHP Error Reporting
PHP Error Reporting
USN : 1SJ15IS114
SEMINOR SUBJECT : FUNDAMENTALS OF WEB
DEVELOPMENT
SEMINOR TOPIC : PHP ERROR REPORTING
SUBMITTED TO : SUSHILAMMA K H
DATE : 04/11/2019
Php has a flexible and customizable system for reporting warnings and
errors that can be set programmatically at runtime or declaratively at design
time within php.ini file.
1. error_reporting
2. display_errors
3. log_errors
ERROR_REPORTING SETTING
It specifies which type of errors are to be reported.
error_reporting(E_ALL);
error_reporting = E_ALL
DISPLAY_ERROR SETTING
This setting specifies whether error messages should or should not be
displayed in the browser.
ini_set(‘display_errors’ , ‘0’ );
display_errors = off
LOG_ERROR SETTING
This setting specifies whether error messages should or should not be sent to
the server error log
ini_set(‘log_errors’ , ‘1’);
log_errors = on
When logging is turned on, error reporting will be sent to either the
operating system’s error log file or to a specified file in the site directory.
If saving error messages to a log file in site directory, file name and path can
be set via the error_log setting programmatically:
ini_set(‘error_log’ , ‘/restricted/my-errors.log’)
error_log = /restricted/my-errors.log