Display Warning and Error Messages on a Specific PHP Script CodeUnit 30 MAR 2009

PHPOften is the case where you are working on a specific PHP script but don’t dare turn on error reporting in PHP since the server you are working on is a production server and that would well, just look kinda bad to the visitors visiting other parts of your site.

The solution is then to add the following minor chunk of code to your script, which will then switch on error reporting for that page and that page alone – pretty handy eh?

ini_set(‘display_errors’, ‘1’);

And there you have it. Go forth and seek out those missing semicolons then! :)

About Craig Lotter

Software developer, husband and dad to two young ladies. Writer behind An Exploring South African. I don't have time for myself any more.