Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26096 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99824 invoked by uid 1010); 19 Oct 2006 20:28:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 99809 invoked from network); 19 Oct 2006 20:28:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Oct 2006 20:28:40 -0000 Authentication-Results: pb1.pair.com header.from=evert@rooftopsolutions.nl; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=evert@rooftopsolutions.nl; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain rooftopsolutions.nl from 66.207.192.7 cause and error) X-PHP-List-Original-Sender: evert@rooftopsolutions.nl X-Host-Fingerprint: 66.207.192.7 smtp0.beanfield.net FreeBSD 4.6-4.9 Received: from [66.207.192.7] ([66.207.192.7:3717] helo=smtp0.beanfield.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A7/AD-27040-6FFD7354 for ; Thu, 19 Oct 2006 16:28:40 -0400 Received: from [66.207.213.206] (66-207-213-206.beanfield.net [66.207.213.206]) by smtp0.beanfield.net (8.13.4/8.12.11) with ESMTP id k9JKR5HU090156; Thu, 19 Oct 2006 16:27:06 -0400 (EDT) (envelope-from evert@rooftopsolutions.nl) Message-ID: <4537DFEF.6030505@rooftopsolutions.nl> Date: Thu, 19 Oct 2006 16:28:31 -0400 Reply-To: evert@rooftopsolutions.nl User-Agent: Thunderbird 1.5.0.7 (Macintosh/20060909) MIME-Version: 1.0 To: Brian Moon CC: Rasmus Lerdorf , internals@lists.php.net References: <4537C21F.9070900@rooftopsolutions.nl> <4537D328.6080706@lerdorf.com> <4537DBEC.8050506@rooftopsolutions.nl> <4537DE0E.7030003@dealnews.com> In-Reply-To: <4537DE0E.7030003@dealnews.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Feature request: ini setting for http 500 on fatal errors From: evert@rooftopsolutions.nl (Evert | Rooftop) Brian Moon wrote: > Evert | Rooftop wrote: >> Thats a smart idea.. I like that >> >> As for letting PHP do the 500, I tend to use output buffering >> everywhere (i think most people do, supposed to be faster too) so I'm >> used to setting header()'s wherever I need them.. > > You think wrong. There are very good reasons not to use output > buffering. > calm down :S >> Besides, in most of my script the business logic gets executed first, >> and this is where most errors can happen.. only after the >> presentation is done. >> >> So the solution would be, if fatal error is triggered, and >> headers_sent() is false then set the error to 500.. > > This produces inconsistent behavior. I would not be in favor of it. > > I suggest you do as Rasmus suggested. Use > register_shutdown_function() perhaps to have a function to change the > status code before output is sent in your specific environment. > Yea I do like that idea, didn't think of that approach. As for inconsistent behaviour.. It's not a huge deal, and the situation can easily described in the documentation. But yea, this is also why I proposed an ini setting. Rasmus' solution solves my problem though. Thanks a lot! Evert