5

Some process in PHP sends messages while it goes.

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

But user doesn't see any message until this process ends. Output buffering in PHP disabled. I'm a client of web-hosting with Apache-server. How to prevent output buffering in .htaccess?

In PHP

  1. ini_set('output_buffering', 0); - no effect
  2. ini_set('output_buffering', 'off'); - no effect
  3. while(ob_end_flush()); flush(); - no effect
  4. ob_implicit_flush(true); ob_end_clean(); - no effect

In .htaccess

  1. php_flag output_buffering off - no effect
  2. php_value implicit_flush on - no effect

Works only:

 echo str_repeat(' ', 32768);

but it's terrible.

Shankar Narayana Damodaran
  • 68,075
  • 43
  • 96
  • 126
Alexander
  • 51
  • 5

0 Answers0