ID: 47687
Updated by: jani@php.net
Reported By: make dot fire at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: HTTP related
Operating System: windows vista
PHP Version: 5.3CVS-2009-03-17 (snap)
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[2009-03-17 14:30:46] make dot fire at gmail dot com
If change to ISAPI mode(use php5isapi.dll), the result is expected.
<?php
header('HTTP/1.1 303 See Other');
header("Location: http://www.php.net/");
exit;
?>
will got status line:
HTTP/1.1 303 See Other
------------------------------------------------------------------------
[2009-03-17 14:24:29] make dot fire at gmail dot com
when use this test code:
test.php:
<?php
header("Location: http://www.php.net/");
exit;
?>
use broswer to visit http://localhost/test.php, the status
line in
response is:
HTTP/1.1 302 Redirect
and use php-cgi.exe under commend line get:
D:\project\www>php-cgi ./test.php
Status: 302 Moved Temporarily
Location: http://www.php.net/
Content-type: text/html; charset=utf-8
------------------------------------------------------------------------
[2009-03-17 14:13:28] make dot fire at gmail dot com
When run php-cgi.exe in command line, the result is expected:
D:\project\www>php-cgi ./test.php
Status: 303 See Other
Location: http://www.php.net/
Content-type: text/html; charset=utf-8
test.php:
<?php
header('HTTP/1.1 303 See Other');
header("Location: http://www.php.net/");
exit;
?>
but visit same file throuth browser and webserver (use
http://localhost/test.php) will get 302 status code.
------------------------------------------------------------------------
[2009-03-17 13:56:28] make dot fire at gmail dot com
I try to use the lastest snapshots (PHP 5.3 (5.3.0beta2-dev),VC9 x86
Non Thread Safe (2009-Mar-17 13:00:00)),got the same result.
some infomation from phpinfo():
System: Windows NT 6.0 build 6001 (Windows Vista Ultimate Edition
Service Pack 1) i586
Build Date: Mar 17 2009 12:55:17
Compiler: MSVC9 (Visual C++ 2008)
Architecture: x86
Server API: CGI/FastCGI
CGI section:
Directive Local Value Master Value
cgi.discard_path 0 0
cgi.fix_pathinfo 1 1
cgi.force_redirect 0 0
cgi.nph 0 0
cgi.redirect_status_env no value no value
cgi.rfc2616_headers 0 0
fastcgi.impersonate 1 1
fastcgi.logging 1 1
webserver is IIS7, PHP run in FastCGI mode(use php-cgi.exe).
I use HttpWatch to catch response header,
when use code:
<?php
header('HTTP/1.1 303 See Other');
header("Location: http://www.php.net/");
exit;
?>
the status line in response is:
HTTP/1.1 302 Redirect
and when use code:
<?php
header('HTTP/1.1 303 See Other');
exit;
?>
the status line in response is:
HTTP/1.1 303 See Other
------------------------------------------------------------------------
[2009-03-17 11:03:24] jani@php.net
First of all, both of your examples work fine for me and produce the
expected results. You did not mention what web server you are using? And
exactly what PHP version are you using?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/47687--
Edit this bug report at http://bugs.php.net/?id=47687&edit=1