How can I disable output buffering in PHP on shared Linux hosting?
<p>I just moved my website to GoDaddy hosting, and got everything working, but the PHP scripts aren't outputting the data immediately -- they're buffering until the script is finished running, and then rendering the whole page at once. And obviously, for long scripts, that's a problem. It didn't used to run that way with my old host, and GoDaddy support says they can't help with this. Here's what I've already tried (without any success)</p>

<ol>
<li>Disabled output compression (zlib, gzip)</li>
<li>Set <code>output_buffering = off</code> in php.ini</li>
<li>Set headers for <code>Cache-Control "max-age=0, no-cache, no-store, must-revalidate"</code>, <code>Pragma "no-cache"</code>, <code>Expires "Wed, 10 May 1985 09:00:00 GMT"</code>, and unset the <code>ETag</code> header</li>
<li>I also tried setting the buffering values in the script itself, using <code>ini_set('output_buffering', 'off')</code>, <code>ini_set('zlib.output_compression', false)</code>, <code>while (@ob_end_flush())</code>, <code>ini_set('implicit_flush', true)</code>, and <code>ob_implicit_flush(true)</code></li>
<li>And I tried running <code>flush()</code> and <code>ob_flush()</code> commands after every <code>echo</code> output</li>
<li>Tried changing the PHP version from the default (5.4 native, which has APC enabled) to 5.4 non-native and 5.5</li>
</ol>

<p>I also created a test script that simply loops for 5 iterations and outputs a line at every iteration, then waits a second before the next iteration. I did this to eliminate any other possible causes of problems. But no matter what I do, the script always waits until it completes before starting to render. </p>

<p>So, is there anything that I can do to make it work properly?</p>