2011-09-23 63 views
0

我在第一次嘗試在fork中使用fork。 當我使用在ubuntu上安裝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沒有啓用,所以我don載php5的源代碼,並做
./configure --enable-pcntl 
make 
make install
但我也會得到同樣的錯誤。 哪裏有問題?

回答

0

執行phpinfo();並查看pcntl是否已啓用。

+0

這不是啓用。我做到了,但我找不到任何pcntl單詞的結果。 –