Jump to content

PHP, IIS 7 and Buffering


Uglybob1

Recommended Posts

Hello, I currently installed php on Windows Vista with IIS 7.0.  For what I am using, everything seems to be working as they did in IIS 6 except for buffering/flushing.  I have a small timer which refreshed the browser every second with a count down, but it seems it does not flush with IIS 7 until the entire page is finished.  I still have the IIS 6 box up which is running the exact same code and I even copied over the same php.ini file so I am thinking it has to be something with IIS 7.  Has anyone run into this problem and/or know of a fix?  Here is the code if need be...

  private function pause($seconds = 1, &$count, $display = FALSE) 
  {
    if($seconds < 0)
      out(__CLASS__."->".__FUNCTION__."(): Parameter seconds($seconds) can not be less then zero<br>");
    else
    {
      $startCount = $count*$seconds;
      for(;$seconds>0;$seconds--)
      {
        if($display && $startCount > 0)
          echo " ".($startCount--);
        ob_flush();
        flush();
        sleep(1);
      }
    }
  }

...so basically it outputs something like  5 4 3 2 1, flushing after each number.  But in IIS 7 it doesn't flush until the entire page is written.

 

Thanks in advance for your time!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.