View Complete Thread
  • Re: IIS7 blocks ob_flush from PHP

    Sep 12, 2011 05:58 AM|Gazmataz|LINK

     Hi Martin,

    Thanks for your reply.  Yes I have redirected that last post here as I believe it was posted in the wrong section.

    Yes I have tried this and many other combinations of flushing the output buffer.  I'm sure the output buffer is being flushed from PHP as I tried the two following code snippets:

     The first - shows the end PHP output buffer length to be 90


    <?php
    ob_start();

    for($i=0;$i<10;$i++){
        echo 'printing...<br />';
        sleep(2);
    }

    $result = ob_get_length();
    echo $result;
    ob_end_flush();
    ob_flush();
    flush();
    ?>

    The Second show the PHP output buffer to be 18 on each sucessive flush indicating that the response is buffered elsewhere?

    <?php
    ob_start();

    for($i=0;$i<10;$i++){
        echo 'printing...<br />';
        $result = ob_get_length();
        echo $result;
        ob_end_flush();
        ob_flush();
        flush();
        ob_start();
        sleep(2);
    }
    ?>

    From what I've seen so far I am really trying to work out how to set the responseBufferLimit to 0 as opposed to the default 4MB on IIS7 running on a windows 2008 r2 server?

    Thanks for your help.