|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51092 HTTP redirection broken in 5.3.1
Submitted: 2010-02-19 19:16 UTC Modified: 2010-02-21 17:17 UTC
From: cpuidle at gmx dot de Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 5.3.1 OS: win32 only - WinXP SP3
Private report: No CVE-ID: None
 [2010-02-19 19:16 UTC] cpuidle at gmx dot de
Sending Location headers in php 5.3.1 does set return status to 302 but does not relay the location header to the client app- preventing redirection from working.

Reproduce code:

header("Location: other.php");


Expected result:
Should open the other.php page.

Actual result:
Nothing. Following output is captured by Firefox- it shows that the location header is missing:

GET /videodb/test.php HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cookie: VDBuserid=1; VDBusername=admin; VDBpassword=368368530; PHPSESSID=1ka2had3fipg89rkt7o9v6s601
Cache-Control: max-age=0

HTTP/1.1 302 Found
Date: Fri, 19 Feb 2010 19:10:41 GMT
Server: Apache/2.2.11 (Win32) PHP/5.3.1
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 20
Keep-Alive: timeout=5, max=98
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-19 19:24 UTC] cpuidle at gmx dot de
Same script btw is working in 5.2.6. on same machine.
 [2010-02-19 19:34 UTC] cpuidle at gmx dot de
Before anybody points me to the HTTP 1.1 spec- this one doesn't redirect either on 5.3.1:


header('Location: http://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']), '/\\').'/other.php');


Best regards,
 [2010-02-19 20:00 UTC]
-Status: Open
+Status: Feedback

Works for me, please try 5.3.2RC2.
 [2010-02-21 09:39 UTC] cpuidle at gmx dot de
No windows binary available on download page :(
 [2010-02-21 09:49 UTC] cpuidle at gmx dot de
OK, found one here:

Still same behavior. No location header, no redirect.
 [2010-02-21 13:23 UTC]
Please try using PHP *5.3.2RC2* and it still works just fine here.

 [2010-02-21 14:34 UTC] cpuidle at gmx dot de
Not sure I can identify the difference, but 5.3.2RC2 is fine with the version you've pointed me to.

Best regards,
 [2010-02-21 16:58 UTC] cpuidle at gmx dot de
I believe I've found the issue here in XDebug:
 [2010-02-21 17:17 UTC]
Not a php bug > bogus.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jul 07 17:05:45 2022 UTC