Realtime output from external command
Posted: Sun Sep 16, 2007 5:21 am
So I've written a little PHP wrapper that lets people execute various (non-PHP) programs through the web. Straight from the PHP manual:
The problem is that, while these programs produce continuous output while running (sometimes for several minutes), PHP waits until the execution is finished and only then barfs out the whole output spew. The user thus doesn't know if the program is still running, hung, or if their network is down! Is there any way to channel the output to screen as it's produced?
Any help would be much appreciated.
Code: Select all
$output = shell_exec('ls -lart');
echo "<pre>$output</pre>";Any help would be much appreciated.