Bug #16842 Updated: header() function doesn`t work

From: Date: Thu, 06 Jun 2002 18:30:31 +0000
Subject: Bug #16842 Updated: header() function doesn`t work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-9662@lists.php.net to get a copy of this message
ID: 16842 Updated by: juts@atlantic.net Reported By: sanya@mail.ru Status: Open Bug Type: HTTP related Operating System: Windows XP PHP Version: 4.2.0 New Comment: This bug is two weeks old. Does anyone have any updates? Thanks. Previous Comments: ------------------------------------------------------------------------ [2002-05-25 11:33:33] ashpool7@yahoo.com Have the same problem with 4.2.1. Similar to carstenseiler. Windows NT SP6a + Hotfixes on Apache 1.3.23. Running as module. Downgrading to 4.1.1 fixes it. ------------------------------------------------------------------------ [2002-05-08 00:32:44] carstenseiler@hotmail.com PHP 4.2 with Apache 2.035 on Win2k Professional SP2 After upgrading to V4.2 I immediately had problems with the header() function. Even a simple script: <?php header("Location: index.php"); ?> does not work. Blank page. ------------------------------------------------------------------------ [2002-05-07 10:07:41] ray@codemain.com Oops. Pardon the above accidental comment submission. I have experienced this problem which causes the PHP to not complete the request. It appears that the culprit is the exit() construct. It also occurs with the die() function. If you remove the exit(); call, the script does not error. if($_GET['test']) { header('Location: http://www.host.dom/otherdir/"); exit(); } else { echo 'ok..'; } f you call the above script as script.php?test=1 with a valid URL for redirect, you will see this error manifest itself. (Confirmed under FreeBSD 4.2) ------------------------------------------------------------------------ [2002-05-07 10:01:51] ray@codemain.com I have experienced this problem also with a very simple script: if($_GET['test']) { header('Location: http://www.amigadev.net/forums/'); error_log("redirecting to forums"); // temp fix for broken PHP 4.2 echo '<HTML><head>'; echo '<META HTTP-EQUIV="Refresh" Content="0; URL=http://www.amigadev.net/forums/">'; echo '</head><body></body></HTML>'; // exit(); // die(); ------------------------------------------------------------------------ [2002-05-02 06:23:55] imshort@beer.com I've come over this too. On a Win95 / Omnithttpd - System. PHP 4.2.0 does not even return ANY headers. Thus, the httpd does not retrun anything to the browser. This does work, however: <?php echo "Content-Type: text/plain\r\n\r\n"; echo "Some text"; ?> ------------------------------------------------------------------------ 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/16842 -- Edit this bug report at http://bugs.php.net/?id=16842&edit=1

« previous php.bugs (#9662) next »