How to to check a php server support for flus

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
montyauto
Forum Commoner
Posts: 25
Joined: Sat Jan 13, 2007 7:05 am

How to to check a php server support for flus

Post by montyauto »

Hi there,

I am working now to get flush working on my page,
I took this script for example:

Code: Select all

<pre>
<?php

ob_end_flush();

echo "Test1\n";
flush();
sleep(3);

echo "Test2\n";

?>
</pre>

It works on my own server but not in a web hosting.

I have put in .htaccess

Code: Select all

<IfModule mod_gzip.c>
mod_gzip_on no
</IfModule>
I put flush all HTML up to and including the <body> tag (<head>, <meta>, etc.), the browser won't respond.

Is there stil something I've missed?
What is the easiest way to check a php server support for flush?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

PHP always supports flush(). Whether the web server it's associated with acknowledges that request is another story. Most web servers that I've used will buffer the output at least a bit before finally sending it to the user.
Post Reply