php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26758 [PATCH] FastCGI exits immediately with status 255
Submitted: 2003-12-31 20:50 UTC Modified: 2004-02-09 19:23 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: tcarter at noggin dot com dot au Assigned:
Status: Closed Package: CGI/CLI related
PHP Version: 5CVS, 4CVS OS: Linux
Private report: No CVE-ID: None
 [2003-12-31 20:50 UTC] tcarter at noggin dot com dot au
Description:
------------
When launched from mod_fastcgi as a dynamic application 
the FastCGI binary exits with status 255 without serving 
any requests. The problem is present in the latest CVS, 
but not present in v4.3.4.  The problem does not occur 
when running the FastCGI binary with a bindpath (-b) 
option. 
 
The problem seems to be that 
php_handle_aborted_connection() is called from the parent 
process in sapi_cgi_bin_flush() and zend_bailout() then 
exits because there is no bailout address set. 
 
Webserver is: 
Apache 2.0.47 (Fedora Core 1) 
mod_fastcgi 2.4.2 
 
PHP Configuration is just: 
./configure --enable-fastcgi 
 
The following seems to fix the problem, but I'm not sure 
it is the right way to fix it: 
 
--- cgi_main.c.bak      2004-01-01 12:38:22.000000000 
+1100 
+++ cgi_main.c  2004-01-01 12:39:34.000000000 +1100 
@@ -271,7 +271,7 @@ 
 #if PHP_FASTCGI 
        if (!FCGX_IsCGI()) { 
                FCGX_Request *request = (FCGX_Request 
*)server_context; 
-               if(!request || FCGX_FFlush( request->out ) 
== -1 ) { 
+               if( !parent && (!request || 
FCGX_FFlush( request->out ) == -1) ) { 
                        php_handle_aborted_connection(); 
                } 
                return; 
 
 
 

Expected result:
----------------
PHP should serve requests and not exit immediately 

Actual result:
--------------
[Thu Jan 01 12:22:54 2004] [warn] FastCGI: scheduled the 
start of the last (dynamic) server 
"/var/www/fastcgi-bin/php-5" process: reached 
dynamicMaxClassProcs (1) 
[Thu Jan 01 12:22:54 2004] [warn] FastCGI: (dynamic) 
server "/var/www/fastcgi-bin/php-5" started (pid 17770) 
[Thu Jan 01 12:22:54 2004] [warn] FastCGI: (dynamic) 
server "/var/www/fastcgi-bin/php-5" (pid 17770) terminated 
by calling exit with status '255' 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-02 17:09 UTC] pmoor at netpeople dot ch
seems to be related/the same as bug #26101.

the supplied patch worked for me.
 [2004-02-04 10:50 UTC] bernhard dot fuerst at skallid dot com
I get the following errors: 

FastCGI: comm with (dynamic) server "/foo/cgi-bin/php" 
aborted: (first read) idle timeout (30 sec)

FastCGI: incomplete headers (0 bytes) received from 
server "/foo/cgi-bin/php"

The supplied patch seems to work for me too.

Running Apache 1.3.26, mod_fastcgi 2.4.1, php-dev from 
2004-02-04
 [2004-02-09 19:23 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC