NYCPHP Meetup

NYPHP.org

[nycphp-talk] Seeking Basic PHP IM/Threaded Msg Bd Suggestion

Chris Shiflett shiflett at php.net
Mon Aug 4 13:05:56 EDT 2003


--- "Sexton, David" <David.SextonJr at ubs.com> wrote:
> I can't seem to get this (your flush example) to work on Win32.
> I've heard that some versions of IE output 1 byte at a time, but
> it works fine from your host with IE6. Anyone know how to get
> this to work with IIS? Thanks.

So you copy/pasted the code and tried it on IIS? I just want to make sure I
understand what isn't working.

That being the case, there are several things that can make flush() not work
like you want (even with Apache). Basically, any buffering is going to screw it
up, unless you can control the buffering also. For example, with ob_start() and
friends, you can ob_flush() and then flush(), and you're fine. Of course, with
Web server buffering, it's not as easy to force it to flush when you want. With
Web client buffering (like some versions of IE use to make it look like they
render faster), I've heard of some "tricks" you can use like generating a bunch
of whitespace output first.

http://www.php.net/flush has this to say:

"Several servers, especially on Win32, will still buffer the output from your
script until it terminates before transmitting the results to the browser."

So, it looks like you might be out of luck on Win32, but maybe Apache still
works, even on Windows.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/



More information about the talk mailing list