centos7安装pcntl扩展

Centos下使用yum安装php默认是都不带pcntl扩展,需要安装扩展需要下载安装包,编译安装。

首先查看你的服务器的php版本

php -v

比如我这里php版本是7.2.5,去官网http://php.net/releases/ 下载对应的安装包

下载完成之后,解压

tar zxvf php-7.2.5.tar.gz

进入扩展目录

cd php-7.2.5/ext/

进入pcntl扩展目录

cd pcntl/

编译安装

/usr/bin/phpize

./configure --with-php-config=/usr/bin/php-config
#注意/usr/bin/php-config 要是你的路径
make && make install

如果不知道php-config位置

whereis php-config

安装完成后提示

Build complete.
Don't forget to run 'make test'.

Installing shared extensions:     /usr/lib64/php/modules/

重启php-fpm

service php-fpm restart

使用命令php -m查看安装的扩展, 如果没有成功,编辑配置文件

vi /etc/php.ini

添加配置

extension='/usr/lib64/php/modules/pcntl.so

猜你喜欢

转载自blog.csdn.net/github_26672553/article/details/80675832
今日推荐