PHP Error Reporting Code

To display PHP error reporting within the code, following post may be helpful.

Enable PHP Display Error

To enable errors, usually errors and warnings, simply add following lines of code in your file, within PHP tags:

error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors','On');

Please note that the above code displays errors and warnings, and not the notices.

To display all the errors in the file, remove the E_NOTICE as below:

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

If you are still unable to see the PHP errors, following post may be helpful:

PHP Errors Display ON and OFF for Windows and Linux (Ubuntu)

Uncategorised

Leave a Reply

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