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! :)

Related Posts:

About Craig Lotter

South African software architect and developer at Touchwork. Husband to a cupcake baker and father to two little girls. I don't have time for myself any more.