This quicktip will teach you on how display PHP errors on your website without altering your php.ini file and by just writing 2 lines of PHP code and including it in your config file or just including it into your page as an include file. Sometimes(or I say “always”) web hosting companies turn “display_errors” configuration to off by default and we don’t have access or cannot modify the php.ini file in our webhosting files. This is useful when you want to find some error that is bugging your pages but cannot see all the errors because of this default configuration set by your web hosting company.
You can put this code in a separate page and call them or you can just copy and paste these 2 lines of code to the pages where you need them.
ini_set('display_errors', 1); error_reporting(E_ALL);
As a security measure always turn this off when you don’t need to debug anymore as error messages can be a tool for potential hackers when seen.












