背景:pcntl扩展可以支持php的多线程操作.
①进入到源码包目录(本人源码包):
cd /root/php-5.6.7/ext/pcntl
②执行:
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
③编译:
make && make install
④添加扩展:
echo extension=pcntl.so >> /usr/local/php/etc/php.ini
⑤重新php-fpm:
systemctl restart php-fpm
⑥检查是否安装成功:
php -m | grep pcntl