note 63301 added to function.ob-start
| From: | php-general at lists dot php dot net | Date: | Sat, 18 Mar 2006 21:42:16 +0000 |
| Subject: | note 63301 added to function.ob-start | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-106053@lists.php.net to get a copy of this message | ||
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?
----
Server IP: 66.207.199.35
Probable Submitter: 198.53.253.173
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.ob-start.php
Edit -- http://master.php.net/note/edit/63301
Del: integrated -- http://master.php.net/note/delete/63301/integrated
Del: useless -- http://master.php.net/note/delete/63301/useless
Del: bad code -- http://master.php.net/note/delete/63301/bad+code
Del: spam -- http://master.php.net/note/delete/63301/spam
Del: non-english -- http://master.php.net/note/delete/63301/non-english
Del: in docs -- http://master.php.net/note/delete/63301/in+docs
Del: other reasons-- http://master.php.net/note/delete/63301
Reject -- http://master.php.net/note/reject/63301
Search -- http://master.php.net/manage/user-notes.php