How to enable PHP error reporting

ini_set('display_errors, 1);
error_reporting(E_ALL);

 

The ini_set function sets a configuration option for the duration of the script execution. When the script is done, the value returns to whatever it was set to originally in the ini file.

The error_reporting function sets the error level to report during the execution of the script.

Here are some of the error levels:

  • E_ERROR
  • E_WARNING
  • E_PARSE
  • E_NOTICE

You can also report all errors with E_ALL, as shown above.

Leave a Reply

Your email address will not be published. Required fields are marked *