热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

为PHP安装yaf拓展

环境:Centos6.9,PHP5.6,yaf2.3.50.准备工作:安装编译工具包yuminstallphp-devel#里面包含phpizeyuminstallpcre-develyum

环境: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/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这个表格,就成功了!

阿里云服务器,现在有幸运券领。

一年8.5折,2年7折,3年5折,想要的速度跟上。使用幸运券购买后,可以参加抽奖!

 


推荐阅读
author-avatar
火山哥哥5237
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有