From: [EMAIL PROTECTED] Operating system: Debian/libc-2.3.1,-2.2.5 PHP version: 4.3.0 PHP Bug Type: HTTP related Bug description: CGI SAPI header("HTTP/1.1 CODE Response") not passed
With PHP-CGI 4.3.0 a header("HTTP/1.x NNN Response"); is not passed from within the script. I discovered that using Nanoweb (the PHP webserver) running below an Apache 1.3.xx (using a wrapper script to accomplish that). I've used the CGI SAPI in a more usual .cgi fashion: the script was called "nph-nww.cgi" (containing a "#!/usr/local/bin/php430" interpreter line at the top, and it was correctly chmoded 755). Such "nph-xxxx.cgi" scripts are treated specially by Apache. Apache does not reparse the header()s of such .cgi's as it usually does. And now the script actually did send a header("HTTP/1.1 200 OK\n"); but this was not passed by this PHP-CGI-4.3.0 and Apache (because enforced not to parse this .cgi's headers for performance reasons) did not add it of course -> so the whole HTTP response now violates the HTTP (because the response then begun with an arbitrary header - "Date:" in my case). This bug occourse for PHP-CGI-5.0.0-dev as well, while previous versions (I tested 4.2.3) passed the "HTTP/1.1" header correctly (same script - no changes!!). The script does something like this: (Note it must be called "nph-whatever.cgi" to test the bug it with Apache): #!/usr/local/bin/php5 <?php header("HTTP/1.1 200 OK\n"); header("X-Server: nph-whatever.cgi"); echo "<HTML>....</HTML>"; ?> Even if Apache gracefully adds the HTTP/1.1 header, this is a bug - and I really would dislike to be enforced to use the CLI SAPI version for CGI scripting from now on :( -- Edit bug report at http://bugs.php.net/?id=21862&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21862&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21862&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21862&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21862&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21862&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21862&r=support Expected behavior: http://bugs.php.net/fix.php?id=21862&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21862&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21862&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21862&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21862&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21862&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21862&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=21862&r=gnused