#27558 [NEW]: Location HTTP header failure

From: Date: Thu, 11 Mar 2004 00:46:16 +0000
Subject: #27558 [NEW]: Location HTTP header failure
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-56269@lists.php.net to get a copy of this message
From:             jeff at qoolio dot org
Operating system: Linux
PHP version:      5.0.0b4 (beta4)
PHP Bug Type:     Output Control
Bug description:  Location HTTP header failure

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 bug report at http://bugs.php.net/?id=27558&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27558&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27558&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27558&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27558&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27558&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27558&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27558&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27558&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27558&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27558&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27558&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27558&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27558&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27558&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27558&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27558&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27558&r=float


Thread (7 messages)

« previous php.bugs (#56269) next »