Reply to pcntl_fork() and apache , redirect to stdout

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация