I'm trying to use fork in php for first time. when I use
$pid = pcnt开发者_如何学Pythonl_fork();
if ($pid == -1) {
die('could not fork');
} else if ($pid) {
// we are the parent
pcntl_wait($status); //Protect against Zombie children
} else {
// we are the child
}
(fork example in php.net) I will received following error.Server error The website encountered an error while retrieving http://localhost/fork.php. It may be down for maintenance or configured incorrectly.I think fork is not enable,so I donwload php5 source code and do
./configure --enable-pcntl make make installbut I will get same error too. where is problem?
execute phpinfo(); and see if pcntl is enabled.
精彩评论