I have below code and want to show echo one by one but whole result returns at once
<?php
for ($i = 1; $i <= 10; $i++){
sleep(1);
echo "$in";
ob_flush();
flush();
}
It is ok in CGI but not in FPM (PHP 8.3 – apache 2.4)
I have tried several things to solve this problem, but none of these solutions worked.
Here are some of them:
ini_set('output_buffering','Off');
ini_set('zlib.output_compression',0);
ini_set('implicit_flush',1);
ob_end_clean();
set_time_limit(0);
ob_implicit_flush(true);
ob_end_flush();
ob_start();
Any solution?