0% found this document useful (0 votes)
37 views

PHP Error Reporting

The document discusses PHP error reporting and describes the three main error reporting flags - error_reporting, display_errors, and log_errors. It explains that error_reporting specifies which types of errors are reported, display_errors specifies whether errors are displayed in the browser, and log_errors specifies whether errors are sent to the server error log. These flags can be set both programmatically and in the php.ini file.

Uploaded by

swapna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

PHP Error Reporting

The document discusses PHP error reporting and describes the three main error reporting flags - error_reporting, display_errors, and log_errors. It explains that error_reporting specifies which types of errors are reported, display_errors specifies whether errors are displayed in the browser, and log_errors specifies whether errors are sent to the server error log. These flags can be set both programmatically and in the php.ini file.

Uploaded by

swapna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

NAME : SWAPNA K A

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.

Three main error reporting flags:

1. error_reporting

2. display_errors

3. log_errors

ERROR_REPORTING SETTING
 It specifies which type of errors are to be reported.

 It can be set programmatically inside any php file using error_reporting( )


function.

error_reporting(E_ALL);

 It can also be set within php.ini file:

error_reporting = E_ALL
DISPLAY_ERROR SETTING
 This setting specifies whether error messages should or should not be
displayed in the browser.

 It can be set programmatically via ini_set( ) function:

ini_set(‘display_errors’ , ‘0’ );

 It can also be set within php.ini file:

display_errors = off

LOG_ERROR SETTING
 This setting specifies whether error messages should or should not be sent to
the server error log

 It can also be set programmatically via ini_set() function:

ini_set(‘log_errors’ , ‘1’);

 It can also be set within php.ini file:

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’)

 It can also be set within php.ini file:

error_log = /restricted/my-errors.log

You might also like