note 70835 added to function.ini-set
| From: | daevid at daevid dot com | Date: | Tue, 31 Oct 2006 01:19:25 +0000 |
| Subject: | note 70835 added to function.ini-set | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119260@lists.php.net to get a copy of this message | ||
Be careful with setting an output_handler, as you can't use ini_set() to change it. *sigh*
In my php.ini I have this for my web pages (and I want it):
output_handler = ob_gzhandler
But this causes my command line scripts to not show output until the very end.
#!/usr/bin/php -q
<?php
ini_set('output_handler', 'mb_output_handler');
echo "\noutput_handler => " . ini_get('output_handler') . "\n";
?>
root@# ./myscript.php
output_handler => ob_gzhandler
Apparently (acording to Richard Lynch):
> TOO LATE!
> The ob_start() has already kicked in by this point.
> ob_flush() until there are no more buffers.
----
Server IP: 64.71.164.2
Probable Submitter: 64.81.162.33
----
Manual Page -- http://www.php.net/manual/en/function.ini-set.php
Edit -- https://master.php.net/note/edit/70835
Del: integrated -- https://master.php.net/note/delete/70835/integrated
Del: useless -- https://master.php.net/note/delete/70835/useless
Del: bad code -- https://master.php.net/note/delete/70835/bad+code
Del: spam -- https://master.php.net/note/delete/70835/spam
Del: non-english -- https://master.php.net/note/delete/70835/non-english
Del: in docs -- https://master.php.net/note/delete/70835/in+docs
Del: other reasons-- https://master.php.net/note/delete/70835
Reject -- https://master.php.net/note/reject/70835
Search -- https://master.php.net/manage/user-notes.php