firefox - php output system() in real time -
i'm trying make system call , have each line sent browser in real time
echo('<pre>'); system('ping -c 10 www.google.com'); echo('</pre>);
this works when call command line (each line of ping output 1 @ time). not work when try open browser (firefox or chrome).
i has output buffering enforced browser. not display new data unless above cetrain threshold. solutions these kind of problems typically involve outputting bunch of blank characters, ie str_repeat(' ',1024*64)
. can think of way browser display output in real time?
you can not way. php request running once , retrun 1 response.
also result of system function shown @ end of execution of command. see in command line logs of command self not php code.
i suggest use kind of long polling technologies or soquet-io establish continues / real time communication server.
Comments
Post a Comment