为PHP安装yaf拓展

环境:Centos6.9,PHP5.6,yaf2.3.5

0.准备工作:安装编译工具包

yum install php-devel #里面包含phpize
yum install pcre-devel
yum install autoconf
yum -y install gcc

1.下载yaf源码

cd /home
mkdir download
cd download
wget http://pecl.php.net/get/yaf-2.3.5.tgz

2.解压
tar zxvf yaf-2.3.5.tgz

3.进入目录
cd yaf-2.3.5

4.生成config(好多教程不写这一步)
/usr/local/php56/bin/phpize

5.编译
./configure --with-php-config=/usr/local/php56/bin/php-config
make && make install

6.更改php.ini

在/etc/php.ini文件里添加一行

extension=yaf.so

7.重启php
/etc/rc.d/init.d/php-fpm restart
这里要特别注意:看一下这个模块加载成功了没。如果出现:
PHP Warning: PHP Startup: taint: Unable to initialize module

就参考我另一篇文章,解决无法加载控件:PHP Startup: taint: Unable to initialize module

最后,去phpinfo()看看结果吧,有yaf这个表格,就成功了!

 

posted @ 2017-11-20 16:28  延吉宝  阅读(181)  评论(0编辑  收藏  举报
粤ICP备13013300号