Doc #54452 [Opn->Csd]: Documentation does not mention that header() will not work in PHP CLI mode.
| From: | frozenfire@php.net | Date: | Sat, 02 Jul 2011 07:40:36 +0000 |
| Subject: | Doc #54452 [Opn->Csd]: Documentation does not mention that header() will not work in PHP CLI mode. | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-6803@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54452&edit=1
ID: 54452
Updated by: frozenfire@php.net
Reported by: busbyjon at gmail dot com
Summary: Documentation does not mention that header() will
not work in PHP CLI mode.
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: OS X 10.6
PHP Version: 5.3.6
-Assigned To:
+Assigned To: frozenfire
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2011-04-02 14:25:37] busbyjon at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=54452&edit=1