I am running one php crawl script in my localhost.
When users fill the form and submit the button, it will post some data to php script(i.e script.php). And it is working right on my localhost, when script.php is running, it shows some information about crawling.
But when I uploaded it to server, the script.php was not shown while processing, only was shown after finished. So I run this below code on server, but also not working (it is working right on localhost).
<?php
header( 'Content-type: text/html; charset=utf-8' );
echo 'Begin ...<br />';
for( $i = 0 ; $i < 10 ; $i++ )
{
echo $i . '<br />';
flush();
ob_flush();
sleep(1);
}
echo 'End ...<br />';
?>
I added all flush method, including ob_implicit_flush(true);
or ob_start()
, but the same.
I think there is a problem on server, but cannot indicate exactly.
Who can help me?