|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23184 (null)-value in front of header-location-request
Submitted: 2003-04-13 04:11 UTC Modified: 2003-04-16 02:44 UTC
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:1 (25.0%)
From: info at speedpartner dot de Assigned:
Status: Closed Package: Output Control
PHP Version: 4.3.1 OS: Linux
Private report: No CVE-ID: None
 [2003-04-13 04:11 UTC] info at speedpartner dot de
Using php4.3.1-cgi I with this script:

  Header("Location: abcdef.php");

and running it with this:

php x.php

results in:
Content-type: text/html
Location: abcdef.php

This null-value in front is only present if I'm using a header-redirect. All setCookie or something works fine and without the null-value.
Problem is that this null badly confuses apache's mod_proxy because it interprets the content-type and location as part of the body of the page and not as real header-values.

Does anybody know where this null comes from? Is it easy to fix somewhere in the source? Need urgent reply!


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-15 21:27 UTC]
Please try using this CVS snapshot:
For Windows:

If the problem persists, check if you have 'cgi.rfc2616_headers' ini setting enabled. Via: <?php var_dump(ini_get("cgi.rfc2616_headers")); ?>
 [2003-04-16 02:10 UTC] info at speedpartner dot de
The precompiled Win32-binaries work perfect. But when compiling the latest source for Linux the problem remains. We're using kernel 2.4.20 with Gcc 3.2. Maybe that's of some help? Already tried to track down the error - but it's not that easy. Where could the string "(null)" instead of "Status: 302" as the first line of output come from?

Is there maybe any string-object freed but used again later? Then maybe this is a problem because of Gcc 3.2? But that's just speculation ...
 [2003-04-16 02:44 UTC] info at speedpartner dot de
Problem resolved - thanks for your help!

The crucial point was the rfc2616-setting. Although I was for some reason not able to set its setting via ini_get (why?) I had a look in the php.ini - and there it was set to 1. Disabling this setting (because we're running Apache - and "0" is okay in this case) helped. Don't know how the "1" came into the settings - but now it works.

Thank you!
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 01 12:01:26 2023 UTC