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.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Does Hostlantern support PHP HTTP Authorization?

Hostlantern supports the PHP HTTP Authorization and in order to enable it you need to add the...

Is PHP Safe Mode turned Off on Hostlantern’s servers

PHP Safe Mode is by default turned off for all PHP versions available on Hostlantern servers....

How to enable zlib compression manually for PHP scripts

PHP Zlib module allows you to transparently read and write gzip compressed files. Thus it is used...

What is SourceGuardian and how to use it?

SourceGuardian is commercial software which allows you to securely encode, compile and encrypt...

How to install Smarty Template Engine

Follow the steps below to install Smarty Template Engine on your hosting account: Download the...