如何禁用 htaccess 中的缓冲?

Ale*_*der 5 php apache .htaccess

PHP 中的某些进程在运行时会发送消息。

 for ($i = 0; $i < 10; $i++) {
      echo "message $i<br>";
      sleep(3);
    }
Run Code Online (Sandbox Code Playgroud)

但在此过程结束之前用户不会看到任何消息。PHP 中的输出缓冲被禁用。我是 Apache 服务器网络托管的客户。如何防止 .htaccess 中的输出缓冲?

在 PHP 中

  1. ini_set('output_buffering', 0); - 没有效果
  2. ini_set('output_buffering', 'off');- 没有效果
  3. while(ob_end_flush()); flush(); - 没有效果
  4. ob_implicit_flush(true); ob_end_clean();- 没有效果

在 .htaccess 中

  1. php_flag output_buffering off - 没有效果
  2. php_value implicit_flush on- 没有效果

仅适用于:

 echo str_repeat(' ', 32768);
Run Code Online (Sandbox Code Playgroud)

但这太可怕了。