Re: Re: Exposing PHP/errors on production vs. dev
| From: | Daniel Brown | Date: | Sat, 02 Aug 2008 17:34:44 +0000 |
| Subject: | Re: Re: Exposing PHP/errors on production vs. dev | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-277626@lists.php.net to get a copy of this message | ||
On Sat, Aug 2, 2008 at 12:52 PM, Al <news@ridersite.org> wrote:
> 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> ';
> }
Quit top-posting, Al, or we'll feed you to the sheep. ;-P
I do a similar thing, but with on-the-fly error display for
debugging. Using sessions, only those with a developer flag see any
errors. The rest are handled in logs (and yes, using E_ALL).
One of my systems uses ~E_CUMMINGS though, because it reports
things too violently.
--
</Daniel P. Brown>
Better prices on dedicated servers:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.