1.下载yaf扩展库源码安装包
官网下载页面:http://pecl.php.net/package/yaf
2.下载yaf扩展库源码安装包
wget -c http://pecl.php.net/get/yaf-3.0.7.tgz
3.解压yaf扩展yaf-3.0.6.tgz包
tar -xzvf yaf-3.0.6.tgz
cd yaf-3.0.6
4.生成编译configure配置文件
sudo /usr/local/php7.2/bin/phpize
如果多个php环境,注意yaf是安装在哪个php的扩展上面的;
5.执行配置文件
sudo ./configure --with-php-config=/usr/local/php7.2/bin/php-config
6.编译并安装
让shell_exec,proc_get_status,proc_open开启,删除/etc/php.ini 下的这个几个单词
sudo make && sudo make install
- #安装完成后会提示
- Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/
7.在PHP的配置文件中引用扩展
vim php.ini
#文件内容末尾加入
extension=yaf.so
8.重启php-fpm服务扩展生效
sudo service php-fpm restart
9. 查看安装的php版本下的扩展
/usr/local/php7.2/bin/php -m
注意:不一定是php -m 查看的
用命令行看到了yaf的扩展,但在phpinfo();上不一定能查看到!