From: carsten_sttgt at gmx dot de Operating system: Windows_NT PHP version: 5.2.5 PHP Bug Type: IIS related Bug description: wrong behaviour with header()
Description: ------------ Hallo, in addition to Bug #42969 I've done some more tests. Tere is really something wrong with header() together with IIS. The behaviour is different, if I use the CGI or ISAPI. First I must also say: I have no problem to set this header correct with ASP, Perl or Phyton. Regardless if I use CGI or ISAPI. Of course with CGI, the name of such a script must be prepend with "nph-". As you can see, the only way to set the correct header/code is: Having PHP as ISAPI and using header() twice. First with the status and second with the location. This is totally different to Apache, where I must use only one header() with location and status as parameter (Testscript 2). Especially with IIS/ISAPI, Testscript 2 should also work. Or remove the status parameter at all: No different behaviour on different platforms. For IIS/CGI the actual result is acceptable. For IIS/NPH-CGI: It's not working in no way at the moment! Regards, Carsten Reproduce code: --------------- Testscript 1 (test.php): ------------------------ <?php header('HTTP/1.0 303 See Other'); header('Location: http://www.example.com/'); ?> Testscript 2 (test.php): ------------------------ <?php header('Location: http://www.example.com/', true, 303); ?> Testscript 3 (nph-test.php): ---------------------------- <?php echo "HTTP/1.0 303 See Other\r\n"; echo "Location: http://www.example.com/\r\n\r\n"; ?> Expected result: ---------------- D:\PHP>pear-request -r 0 -S http://localhost/test.php GET http://localhost/test.php --> 303 See Other Actual result: -------------- Testscript 1, 2 and 3 with nph-cgi: | D:\PHP>pear-request -r 0 -S http://localhost/nph-test.php | GET http://localhost/nph-test.php --> ERROR: Malformed response Testscript 1 with ISAPI: | D:\PHP>pear-request -r 0 -S http://localhost/test.php | GET http://localhost/test.php --> 303 See Other Testscript 1 with CGI: | D:\PHP>pear-request -r 0 -S http://localhost/test.php | GET http://localhost/test.php --> 302 Object Moved Testscript 2 with ISAPI: | D:\PHP>pear-request -r 0 -S http://localhost/test.php | GET http://localhost/test.php --> 303 Undescribed Testscript 2 with CGI: | D:\PHP>pear-request -r 0 -S http://localhost/test.php | GET http://localhost/test.php --> 302 Object Moved -- Edit bug report at http://bugs.php.net/?id=43256&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43256&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43256&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43256&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43256&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=43256&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=43256&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=43256&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=43256&r=needscript Try newer version: http://bugs.php.net/fix.php?id=43256&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=43256&r=support Expected behavior: http://bugs.php.net/fix.php?id=43256&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=43256&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=43256&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=43256&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43256&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=43256&r=dst IIS Stability: http://bugs.php.net/fix.php?id=43256&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=43256&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=43256&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=43256&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=43256&r=mysqlcfg