Doc #54452 [NEW]: Documentation does not mention that header() will not work in PHP CLI mode.

From: Date: Sat, 02 Apr 2011 12:25:38 +0000
Subject: Doc #54452 [NEW]: Documentation does not mention that header() will not work in PHP CLI mode.
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-6174@lists.php.net to get a copy of this message
From: Operating system: OS X 10.6 PHP version: 5.3.6 Package: Documentation problem Bug Type: Documentation Problem Bug description:Documentation does not mention that header() will not work in PHP CLI mode. Description: ------------ --- From manual page: http://www.php.net/function.header#Notes --- headers (and headers_list() and headers_sent()) will NOT work using the php command line as this has been moved into the php-cgi binary. This is detailed in an earlier bug report, but not mentioned at all on these documentation pages. Test script: --------------- <?php ob_start(); setcookie("TestCookie","SomeValue"); header("X-Sample-Test: foo"); header('Content-type: text/plain'); ?> <html> <body> <?php // What headers are to be sent? var_dump(headers_list()); ?> </body> </html> <?php ob_end_flush();?> Expected result: ---------------- <html> <body> array(0) { << headers here >> } </body> </html> Actual result: -------------- <html> <body> array(0) { } </body> </html> -- Edit bug report at http://bugs.php.net/bug.php?id=54452&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54452&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54452&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54452&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=54452&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54452&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=54452&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=54452&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=54452&r=needscript Try newer version: http://bugs.php.net/fix.php?id=54452&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=54452&r=support Expected behavior: http://bugs.php.net/fix.php?id=54452&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=54452&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=54452&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=54452&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54452&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=54452&r=dst IIS Stability: http://bugs.php.net/fix.php?id=54452&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=54452&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=54452&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=54452&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=54452&r=mysqlcfg

« previous php.doc.bugs (#6174) next »