title: failed to flush buffer. No buffer to flush with ob_end_flush() method
body: <p>My site is streaming mp3 file, intermittenly I saw Notice error in log file:</p>
  
  <pre><code>Notice: failed to flush buffer. No buffer to flush in
  </code></pre>
  
  <p>Below is the code:</p>
  
  <pre><code>$filename = 'audio.mp3';
  header("Content-Type: audio/mpeg");
  header("Content-Length: ".filesize($filename));
  header('Content-Disposition: inline; filename="' . $filename);
  header("X-Pad: avoid browser bug");
  header("Cache-Control: no-cache");
  ob_clean();
  flush();
  set_time_limit(0);
  $size = filesize($filename); 
  $chunksize = 1 * (1024 * 1024);
  if ($size &gt; $chunksize) {
      $handle = fopen($filename, 'rb');
      $buffer = '';
      while (!feof($handle)) {
          $buffer = fread($handle, $chunksize);
          ob_start();
          echo $buffer;
          ob_end_flush();
          flush();
      }
      fclose($handle);
  } else {
      readfile($filename);
  }
  </code></pre>
  
  <p>The error always refers to <strong>ob_end_flush();</strong> line.</p>