开发者

install php fork on ubuntu

开发者 https://www.devze.com 2023-04-07 04:39 出处:网络
I\'m trying to use fork in php for first time. when I use $pid = pcnt开发者_如何学Pythonl_fork();

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

精彩评论

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