We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

PHP Buffered Output not flushing to browser (IIS8)RSS

1 reply

Last post Jun 20, 2013 06:04 AM by Chen Yu - MSFT

  • PHP Buffered Output not flushing to browser (IIS8)

    Jun 17, 2013 01:59 PM|tech85|LINK

    Hello,

    I am having some issues with flushing the buffered output to the browser and i thought i should ask here.
    No matter what i tried, i cannot seem to make php output echos while it's running the script.

    After many hours of research i gave up and thought i should ask for some help. The search feature on this web site doesn't work so please don't tell me to search the forums first, as i have tried :)

    I am using IIS 8.

    Ok, so i am running a large PHP script with Oracle (OCI8) integration and here is what it basically does:

    foreach($items as $itemarray){
    	echo " <tr>\n";
    			$error = checkValuesAndDisplay($itemarray);
    			if($error[0]){ $fail = true;}
    			if($error[1]){ $options = true;}
    echo " </tr>\n";
    }

    Basically the function checkValuesAndDisplay checks some items to see if they are in the database and returns some errors depending on what it finds.

    Now, the $itemarray has a lot of items in it, sometimes even thousands. Script execution sometimes can take upwards of 20 minutes.

    The problem i'm having is that i cannot seem to get it to flush the output after each iteration.

    I tried this here: http://forums.iis.net/t/1078563.aspx/1

    I added responseBufferLimit="1024", i made sure output_buffering and implicit_flush is set to 0 in php.ini. (i also tried responseBufferLimit to 0)

    Then i tried adding a flush() and usleep(50000) at the end of the function, no luck. I even added ob_flush() and that also didn't work. (I shouldn't have to add ob_flush as output_buffering is 0 in php.ini).


    At first i thought this is due to me using chrome, but i tried on IE9 and IE10 and same thing there... 

    Does anyone have any ideas as to what else i could try?

    Thanks in advance!

  • Re: PHP Buffered Output not flushing to browser (IIS8)

    Jun 20, 2013 06:04 AM|Chen Yu - MSFT|LINK

    Hi,

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

    Regards,

    Please mark the replies as answers if they help or unmark if not.
    Feedback to us