RE: [PHP] How to disable output buffer per script
| From: | Michael Sims | Date: | Tue, 08 Jun 2004 15:15:10 +0000 |
| Subject: | RE: [PHP] How to disable output buffer per script | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-187884@lists.php.net to get a copy of this message | ||
Mike Zornek wrote:
> I wrote an importer script in PHP that outputs the percentage of items
> finished in 5% chunks. When I run the script however (web or command
> line) I don¹t get incremental output .. I get it all in one fell
> swoop.
>
> I have a feeling PHP is buffering it or something. It there any
> command I can use to disable such buffering for just this script so I
> can see some useful feedback. Thanks!
Try calling ob_end_flush() at the top of your script. Although I believe some
browsers will still buffer a portion of the output before displaying. But if you're
running from the command line it should display in real time. HTH...