December 2010

Error reporting in PHP scripts

It often happens that you are trying to debug a PHP script running from command line or a part of your code and the script mysteriously dies. Depending on your server configuration (or command line) errors may be being silently being hidden. In those cases I recommend you add the following lines to your code to guarantee that all errors, notices, etc will be printed.

<?php