Knowledge Base Article

How to enable error reporting in a PHP script?

There are two ways to enable error reporting in your PHP scripts.

 

1. You can add the following function in the .php file for which you would like the error reporting enabled:

 

error_reporting(E_ALL);

 

2. You can add the following option in the php.ini file for your web site:

 

error_reporting = E_ALL

 

Those will enable reporting for all PHP errors. The detailed error_report documentation and various options you can set can be found in the official PHP documentation at:

 

http://php.net/error-reporting

 

At SiteGround PHP error reporting is enabled by default for all hosting accounts.



Rating

Please indicate if this article was helpful for you.

rating :  4.5 from 5
views :  2501
votes :  8

Related Articles

Views

Haven't found what you are looking for? Suggest an article HERE.

powered by

Valid XHTML 1.0 Strict Valid CSS!