我第一次尝试在php中使用fork。 当我使用
$pid = pcntl_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
}
(php.net中的fork示例)时,我会收到以下错误。Server error The website encountered an error while retrieving http://localhost/fork.php. It may be down for maintenance or configured incorrectly.我认为fork没有启用,所以我下载php5源代码并执行
./configure --enable-pcntl make make install但我也会得到同样的错误。 哪里有问题?
答案 0 :(得分:0)
执行phpinfo();并查看是否启用了pcntl。