PHP Display Errors Error Reporting Debugging Etc
Ideally, you will be using php.ini to display errors in php. However, sometimes you don’t have access to it, and you need some instant gratification now! Include this snippet in your page, and it will display the errors inline, as well as save them to a file in your current directory called “error_log.txt”.
ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
error_reporting(E_ALL);
Now isn’t that just special?
The source: php display errors