Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:16124 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33772 invoked by uid 1010); 28 Apr 2005 13:15:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 33757 invoked from network); 28 Apr 2005 13:15:31 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 28 Apr 2005 13:15:31 -0000 X-Host-Fingerprint: 195.197.172.115 gw01.mail.saunalahti.fi Linux 2.4/2.6 Received: from ([195.197.172.115:36493] helo=gw01.mail.saunalahti.fi) by pb1.pair.com (ecelerity 1.2.12rc1 r(5476:5477)) with SMTP id 94/FA-20173-3F1E0724 for ; Thu, 28 Apr 2005 09:15:31 -0400 Received: from nest.netphobia.fi (YZCLXVIII.dsl.saunalahti.fi [85.76.34.69]) by gw01.mail.saunalahti.fi (Postfix) with ESMTP id B0671DF43E; Thu, 28 Apr 2005 16:15:05 +0300 (EEST) Received: from nest.netphobia.fi (nest.netphobia.fi [127.0.0.1]) by nest.netphobia.fi (8.13.4/8.13.1) with ESMTP id j3SDF7Qf014086; Thu, 28 Apr 2005 16:15:07 +0300 Received: from localhost (jani@localhost) by nest.netphobia.fi (8.13.4/8.13.1/Submit) with ESMTP id j3SDF6er014083; Thu, 28 Apr 2005 16:15:06 +0300 X-Authentication-Warning: nest.netphobia.fi: jani owned process doing -bs Date: Thu, 28 Apr 2005 16:15:06 +0300 (EEST) Reply-To: Jani Taskinen To: Sascha Schumann Cc: internals@lists.php.net In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: #28074 [Opn->Asn]: Fast CGI standard compliance : stderr should be written in a FCGI stderr stream (fwd) From: sniper@iki.fi (Jani Taskinen) I addded fastcgi.logging ini option. Set that to 0 and you'll get the original behaviour back. --Jani On Thu, 28 Apr 2005, Sascha Schumann wrote: > I'm more of the mindset that whoever breaks it, also fixes > it. > > My current 'fix' would simply revert that patch. If you > agree with that, I will happily follow through. > > - Sascha > > ---------- Forwarded message ---------- > Date: Thu, 28 Apr 2005 12:58:05 +0200 > From: sniper@php.net > To: sas@php.net > Subject: #28074 [Opn->Asn]: Fast CGI standard compliance : stderr should be > written in a FCGI stderr stream > > sas@php.net you have just been assigned to this bug by sniper@php.net > > ID: 28074 > Updated by: sniper@php.net > Reported By: bogus_idp at yahoo dot fr > -Status: Open > +Status: Assigned > Bug Type: CGI related > Operating System: * > PHP Version: 4CVS, 5CVS (2005-01-10) > -Assigned To: > +Assigned To: sas > New Comment: > > Feel free to fix it then. > > > > Previous Comments: > ------------------------------------------------------------------------ > > [2005-04-21 11:43:51] sas@php.net > > This is an ugly change for users who redirect PHP's stderr to a log > file due to file permissions (PHP is not allowed to open the log > file). > > Instead of writing to the log file, the Apache log now contains tons of > rows like this: > > [Thu Apr 21 11:18:27 2005] [error] [client 129.0.10.119] FastCGI: > server "/home/www/PHP/php/bin/php" stderr: array ( > [Thu Apr 21 11:18:27 2005] [error] [client 129.0.10.119] FastCGI: > server "/home/www/PHP/php/bin/php" stderr: 'rcs' => > [Thu Apr 21 11:18:27 2005] [error] [client 129.0.10.119] FastCGI: > server "/home/www/PHP/php/bin/php" stderr: array ( > > etc. > > This needs to be addressed -- make logging to fastcgi's stderr > optional. > > > ------------------------------------------------------------------------ > > [2005-01-10 16:01:29] chris at ex-parrot dot com > > This one turns out to be easy to fix, thus: > > --- cgi_main.c.orig Mon Jan 10 14:57:04 2005 > +++ cgi_main.c Mon Jan 10 14:53:44 2005 > @@ -481,7 +481,14 @@ > > static void sapi_cgi_log_message(char *message) > { > - fprintf(stderr, "%s\n", message); > +#if PHP_FASTCGI > + if (!FCGX_IsCGI()) { > + FCGX_Request *request = (FCGX_Request *)SG(server_context); > + FCGX_FPrintF( request->err, "%s\n", message ); > + /* ignore return code */ > + } else > +#endif /* PHP_FASTCGI */ > + fprintf(stderr, "%s\n", message); > } > > static int sapi_cgi_deactivate(TSRMLS_D) > > > However, there is another similar bug, which is that a stream opened on > "php://stderr" should also direct its output to the FCGI error stream > (rather than just to file descriptor #2). > > -- Chris Lightfoot > > ------------------------------------------------------------------------ > > [2004-04-20 12:03:30] bogus_idp at yahoo dot fr > > Description: > ------------ > The Fast CGI standard require that error be reported through the > FastCGI connection as a Stderr data stream. > But PHP Fast CGI processes still write errors to original stderr (file > handle 3) which prevent from clean standard centralized FCGI logging, > especially when the Fast CGI PHP process is not started by the web > server (remote Fast CGI). > > In most cases, it makes debugging PHP scripts impossible. > > > > ------------------------------------------------------------------------ > > > -- Donate @ http://pecl.php.net/wishlist.php/sniper