shell_exec() in PHP
Posted
by Amar Ravikumar
on Stack Overflow
See other posts from Stack Overflow
or by Amar Ravikumar
Published on 2010-04-08T14:16:21Z
Indexed on
2010/04/08
15:33 UTC
Read the original article
Hit count: 604
<?php
// Execute a shell script
$dump = shell_exec('bigfile.sh'); // This script takes some 10s to complete execution
print_r($dump); // Dump log to screen
?>
When the script above is executed from the browser, it loads for 10s and the dumps the output of the script to the screen. This is, of course, normal. But if I want the data written to STDOUT by the shell script to be displayed on the screen in real-time, is there some way I could do it?
© Stack Overflow or respective owner