note 63301 deleted from function.ob-start by mazzanet
| From: | mazzanet@php.net | Date: | Sun, 19 Mar 2006 01:17:38 +0000 |
| Subject: | note 63301 deleted from function.ob-start by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106060@lists.php.net to get a copy of this message | ||
Note Submitter:
----
ive just tried the following code, and it wont work!
1 <?php
2 ob_start("");
3 echo "hi";
4 setcookie("bob", 1, time()+9999999, "/");
5 ob_end_flush();
6 ?>
PHP Warning: Cannot modify header information - headers already sent by (output started at
C:\\Program Files\\Apache Group\\Apache2\\htdocs\\obtest.php:3) in C:\\Program Files\\Apache
Group\\Apache2\\htdocs\\obtest.php on line 4
PHP Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush. in
C:\\Program Files\\Apache Group\\Apache2\\htdocs\\obtest.php on line 5
i see that i have output_buffering = 0 in my phpinfo page, as it is commented out in my
configuration.
i dont want to have output buffering by default on all files, but it seems that the only time output
buffering ACTUALLY does its job and sends headers first is when i turn this directive on.
is this a bug in version 5.1.2 or is there something else that is to blame?