#27558 [Opn->Fbk]: Location HTTP header failure
| From: | sniper@php.net | Date: | Thu, 11 Mar 2004 00:48:12 +0000 |
| Subject: | #27558 [Opn->Fbk]: Location HTTP header failure | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-56270@lists.php.net to get a copy of this message | ||
ID: 27558
Updated by: sniper@php.net
Reported By: jeff at qoolio dot org
-Status: Open
+Status: Feedback
Bug Type: Output Control
Operating System: Linux
PHP Version: 5.0.0b4 (beta4)
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
And does this happen with PHP 4.3.4 ?
Previous Comments:
------------------------------------------------------------------------
[2004-03-10 19:46:16] jeff at qoolio dot org
Description:
------------
I am using PHP5 beta 4 and am experiencing a failure to redirect when
using the header() function with the Location HTTP header. I have found
that adding a print(" ") line after the header() call results in a
successful redirect.
My configuration is:
#!/bin/sh
./configure \
--prefix=/opt \
--enable-inline-optimization \
--disable-short-tags \
--with-apache-hooks=/opt/httpd/bin/apxs \
--disable-cgi \
--with-sqlite \
--enable-sysvshm \
--enable-sysvsem \
--enable-sysvmsg \
--with-zlib=/usr \
--with-libxml-dir \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-zlib-dir \
--with-ttf \
--with-freetype-dir \
--with-mysql=/usr \
--with-pgsql \
--with-expat-dir=/usr \
--with-xsl \
--enable-exif \
--enable-soap \
--with-xmlrpc
This problem happens whether the .ini setting for output_buffering is
On or Off. I have no special settings in my php.ini.
Reproduce code:
---------------
<?php
header("Location: http://www.php.net/");
?>
This code fails to redirect.
<?php
header("Location: http://www.php.net/");
print(" ");
?>
This code succesfully redirects
For now, this can be tested at:
http://blog.qoolio.org:82/header_test.php
(w/o print)
http://blog.qoolio.org:82/header_test2.php
(w/print)
Expected result:
----------------
Successful HTTP redirect via Location header.
Actual result:
--------------
Failure to redirect.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27558&edit=1