title: Disabling output buffering in PHP
body: <p>I have an object for tasks and on __deconstruct(), it's meant to run some of the lengthier cleanup tasks after the rest of the page has already loaded. Unfortunately, it buffers the output and won't send it until after the tasks are finished (nothing is printed in the tasks).</p>
  
  <p>I've read through <a href="http://www.php.net/flush" rel="nofollow">http://www.php.net/flush</a> and tried all the suggestions there. Obviously I've tried disabling output_buffering in php.ini. I've disabled deflate_module, zlib compression is off, don't have mod_gzip. Calling flush() or ob_flush() has no effect, nor does enabling implicit_flush.</p>
  
  <p>I'm just running XAMPP (currently apache 2.2.17, php 5.3.4) under Windows Server 2008 R2. PHP is being run as a module.</p>
  
  <p>And yes, I could set up some little AJAX hack to run the task manager or even set up a scheduled task to run this specific task, but output buffering has been an issue elsewhere, too. Would just like it to be gone sometimes.</p>
  
  <p>From a similar thread, someone suggested seeing what the following would do:</p>
  
  <pre><code>&lt;?php
  while (TRUE)
  {
      echo 'x';
      flush();
      sleep(1);
  }
  ?&gt;
  </code></pre>
  
  <p>As expected, the page displays nothing until the maximum execution time is reached, at which point it flushes the buffer.</p>
  
  <p>This has become extremely frustrating. Anyone have any ideas what could still be causing it to buffer?</p>