Re: Output buffering help please
| From: | Kevin Stone | Date: | Mon, 12 May 2003 21:30:35 +0000 |
| Subject: | Re: Output buffering help please | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147354@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "Gareth Hastings" <gareth@netgs.co.uk>
To: <php-general@lists.php.net>
Sent: Monday, May 12, 2003 3:06 PM
Subject: [PHP] Output buffering help please
> I'm not sure if this is being done by apache or php but basically I run
> 2 linux machines both with apache and php installed. On machine1 when I
> run long scripts I already see the results being sent to my browser
> before the script has finished. This is good and I want the other
> machine to do this but it doesn't. It buffers the whole page then sends
> it to the browser. Reason being I want to display the results of various
> scripts in realtime. I've checked in php.ini and output_buffering is off
> on both machines.
>
> Machine1:
> 2.4.18-14
> 4.2.2
> Apache/2.0.40
>
> Machine2:
> 2.4.20-gentoo-r2
> apache-2.0.45
> php-4.3.1-r1
>
> Maybe this is more an apache related question? But is there anything
> else that could be causing this buffering effect?
>
> Thanks
>
> Gareth
Use flush() to override the display buffer. Example..
<? // test buffer flush..
for($i=0; $i<10; $i++)
{
echo $i;
flush();
sleep(1);
}
?>
- Kevin