php安装pcntl扩展

  1. 下载一个同样版本的php(我的是php5.6.27,我下的是php5.6.28)
wget http://hk1.php.net/get/php-5.6.28.tar.gz/from/this/mirror
  1. 解压php
tar -zxvf mirror
  1. 进入php/ext/pcntl/
cd ext/pcntl/
  1. 执行命令phpize
 /usr/bin/phpize 

回显:

Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226

  1. 执行配置命令php-config
./configure --with-php-config=/usr/bin/php-config
  1. 编译make && make install
make && make install
  1. 修改php.ini支持pcntl
echo "extension=pcntl.so" >> /etc/php.ini

这是基于web模试下的配置文 件,如果在命令行下,如使用workman框架,那么配置文件不在此处,可参考此篇博客

  1. 查看phpinfo(),是否有pcntl扩展;
    在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qwq1503/article/details/89432261