I can not for that existence of me obtain the PHP flush function to operate correctly, using WAMP. Here's some sample code, said out are all the various things I have attempted:

//apache_setenv('no-gzip', 1); // returns error that apache_setenv does not exist
//ini_set('zlib.output_compression',0);
//ini_set('implicit_flush',1);
//ob_end_clean();
//for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); }
//ob_implicit_flush(1);
set_time_limit(0);
echo "<pre>";
for ($i = 0; $i < 100; ++$i) {
    echo $i.' '.time().str_repeat(' ',256)."\n";
    //ob_flush(); // returns error without output buffering enabled
    flush();
    usleep(100000);
}

It appears regardless of what I actually do, I usually obtain the results altogether in a single giant chunk. This is a screenshot of all the different configurations I've set from WAMP: from left to right: php extension, php setting, apache modules

Edit: I have submitted the exact same code to some server running on cPanel/linux, and delay pills work perfect in most browsers. Why can't I recieve results correctly on the localhost WAMP server??

flush() might not have the ability to override the loading plan of the web server and contains no impact on any client-side loading within the browser. Additionally, it does not affect PHP's userspace output loading mechanism. What this means is you'll have to call both doctor_flush() and flush() to purge the doctor output buffers if you work with individuals.

Several servers, especially on Win32, will still buffer the output out of your script until it terminates before transmitting the outcomes towards the browser.

Server modules for Apache like mod_gzip may do loading that belongs to them which will cause flush() not to lead to data being sent immediately towards the client.

The browser may buffer its input before exhibiting it. Netscape, for instance, buffers text until it receives an finish-of-line or the start of a tag, also it will not render tables before the tag from the outermost table is viewed.

Some versions of Microsoft Ie is only going to begin to display the page once they have obtained 256 bytes of output, so you may want to send extra whitespace before eliminating to obtain individuals browsers to show the page.

  • php.internet

Use doctor_flush() before flush()