php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48041 no headers sent if output is blank when using mod_fcgid 2.2
Submitted: 2009-04-22 09:52 UTC Modified: 2009-04-30 08:47 UTC
From: mortals at seznam dot cz Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 5.2.9 OS: linux
Private report: No CVE-ID: None
 [2009-04-22 09:52 UTC] mortals at seznam dot cz
Description:
------------
no headers sent if output is blank on 64bit system (for example redirection dont work). 5.2.9 on 32bit servers is ok.

Reproduce code:
---------------
<?
$test = 0;
?>

or

<? 
header('HTTP/1.1 301 Moved Permanently'); 
header('Location: http://www.example.com'); 
?>


Expected result:
----------------
telnet example.com 80
GET /test.php HTTP/1.1
Host: example.com 

HTTP/1.1 200 OK
Date: Wed, 22 Apr 2009 09:23:11 GMT
Server: Apache
Cache-Control: max-age=7200
Expires: Wed, 22 Apr 2009 11:23:11 GMT
Content-Length: 0
Content-Type: text/html

Connection closed by foreign host.


Actual result:
--------------
telnet example.com 80
GET /test.php HTTP/1.1
Host: example.com

Connection closed by foreign host.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-23 16:13 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

I can not reproduce this on 3 servers (all being 64bit..)
 [2009-04-24 08:37 UTC] mortals at seznam dot cz
ok, little more info for reproduce:

I am using distribution gentoo and fastcgi (fcgid), but I have try minimal manually instalation without extensions:

./configure --prefix=/usr/local/php5latest --host=x86_64-pc-linux-gnu --enable-cgi --enable-fastcgi --enable-force-cgi-redirect --with-config-file-path=/etc/php/cgi-php5 --without-pear

/usr/local/php5latest/bin/php-cgi -v
PHP 5.2.10-dev (cgi-fcgi) (built: Apr 24 2009 10:06:17)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

in virtualhost is 
<directory /home...>
FCGIWrapper /usr/local/php5latest/bin/php-cgi .php
</directory>

and still doesnt work.

I have added `echo $test;` to example reproduce code and headers are sent, without echo no headers.

I have make strace with output:
http://www.korous.net/strace-echo.txt
and without output:
http://www.korous.net/strace-noecho.txt
 [2009-04-24 11:53 UTC] lbarnaud@php.net
Could you please sent the output of the following command:
"/usr/local/php5latest/bin/php-cgi -i"
 [2009-04-24 13:00 UTC] mortals at seznam dot cz
output of /usr/local/php5latest/bin/php-cgi -i
http://www.korous.net/phpcgi_i.html
 [2009-04-24 13:38 UTC] lbarnaud@php.net
Both display_errors and log_errors are Off, please try enabling one of them and check if you have any error. Please also check if you have any differences compared to your 32bit setup (ini settings, fcgi module, etc). Also check your apache error log with LogLevel set to debug, eventually mod_fcgid logs, etc.
 [2009-04-27 09:05 UTC] mortals at seznam dot cz
reproduced only with version mod_fcgid 2.2. and php5.2.9
with mod_fcgid2.1 or with php5.2.8 headers are sent

php5.2.9 and fcgid2.2 on 32bit system works
on both system is same version of apache2.2.9 

no different in ini settings, no errors after set display_errors on and no errors in apache log with loglevel debug

same settings of apache and fcgid:
<IfModule mod_fcgid.c>
  AddHandler fcgid-script .php
  SocketPath /var/tmp/fcgid-ipc
  IdleTimeout 60
  MaxProcessCount 1000
  IPCCommTimeout 30
  IPCConnectTimeout 30
  BusyTimeout 700
  SharememPath /tmp/apache-fcgid-shm
</IfModule>
 [2009-04-27 15:24 UTC] jani@php.net
Can you reproduce this with mod_fastcgi?
 [2009-04-28 12:12 UTC] mortals at seznam dot cz
it works with mod_fastcgi 
hmm, perhaps bug in fcgid...
 [2009-04-28 17:52 UTC] jani@php.net
Please report this to the mod_fcgid people. It seems more like a bug in 
mod_fcgid since I can't reproduce it with lighttpd's fastcgi either..
 [2009-04-29 10:21 UTC] mortals at seznam dot cz
My collegue has patched mod_fcgid with
http://people.apache.org/~chrisd/patches/mod_fcgid_auth/mod_fcgid-1auth-trunk.patch
and I didnt know it.
Without this patch php5.2.9 works.

So, perhaps bug is in this patch, but older version of PHP works with them, maybe bug in PHP too?
 [2009-04-30 08:47 UTC] jani@php.net
Just fix your bad patches.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Dec 04 15:01:23 2020 UTC