Re: Exposing PHP/errors on production vs. dev
| From: | Al | Date: | Sat, 02 Aug 2008 16:52:03 +0000 |
| Subject: | Re: Exposing PHP/errors on production vs. dev | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-277623@lists.php.net to get a copy of this message | ||
Here' the snippet I use on all my code files. Default is create and add to error log file on the current dir.
I generally echo $error_reporting to remind myself that the error reporting is active.
if(true) // TRUE for debug only
{
ini_set("display_errors", "on"); //use off if users will see them
error_reporting(E_ALL);
$error_reporting = '<span style="color:red">Error display and logging on</span> ';} mike wrote:
Does this look right? Obviously you still want to know about production errors, so I'd like to log them. Development I want to see -everything- and I want it to display on the page. The assumption is production won't have any notices as the code should be clean and our higher priority are fixing errors. But that one is easily editable if needed :) Production:display_errors = Offdisplay_startup_errors = Offerror_reporting = E_ALL & ~E_NOTICE expose_php = Off log_errors = On error_log = syslogDev:display_errors = Ondisplay_startup_errors = Onerror_reporting = E_ALL expose_php = On log_errors = On error_log = syslogAm I missing any?