由于我的php是用yum安装的,默认没有安装pcntl,下面记录下安装pcntl的过程。
系统:centos
php:5.1.6(如不知道php的版本可以用php -v查看)
先下下载对应php版本的pcntl,
[root@localhost tmp]#wget http://museum.php.net/php5/php-5.1.6.tar.gz
[root@localhost tmp]#tar zxvf php-5.1.6.tar.gz
[root@localhost tmp]cd php-5.1.6/ext/pcntl
[root@localhost pcntl]# find / -name php-config
/usr/bin/php-config
[root@localhost pcntl]# ./configure –with-php-config=/usr/bin/php-config
[root@localhost pcntl]# make
[root@localhost pcntl]# make install
Installing shared extensions: /usr/lib/php/modules/
[root@localhost pcntl]# cd /usr/lib/php/modules/
由上可以看出pcntl.so已经生成在扩展目录 /usr/lib/php/modules/
接着在php.ini文件中加入一句 extension=pcntl.so
最后[root@localhost modules]# service httpd restart
停止 httpd:[确定]
启动 httpd:[确定]
安装完成,可以通过phpinfo();是否增加了pcntl扩展
联系客服