开发者

install php fork on ubuntu

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 install
but I will get same error too. where is problem?


execute phpinfo(); and see if pcntl is enabled.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜