Posted by David on 07/03/06 15:22
Hello,
I'm trying to run a system call('ls' in this simple case) that is taking
quite a long. I would like to fork the system call into a child process
and waits display the output of the call while it is running.
Here is a piece of code:
$pid = pcntl_fork();
for ($i = 1; $i <= 5; ++$i) {
$pid = pcntl_fork();
if (!$pid) {
$query = "ls /tmp";
system ($query,$ret_val);
print "In child $i\n";
exit;
}
}
How can i make this script dynamic in my web page. Meaning how can i
print each loop while the child process is running in Apache and
redirect to STDOUT in the webpage???
[Back to original message]
|