Display PHP Errors When Display_errors Is Disabled

When Display_errors is off in php.ini it is hard to see where the bug is!

While you are working in server where display errors are off you can add this code on top of the page and it will show whats going on in your php code.

ini_set('display_errors', 1);
 ini_set('log_errors', 1);
 ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
 error_reporting(E_ALL);

I prefer to use this code through a function or include file and when you are done you can close or disable.

Share

One thought on “Display PHP Errors When Display_errors Is Disabled

Leave a Reply

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