Linux下PHP7安装yaf扩展

8 篇文章 0 订阅

Yaf扩展是为php yaf框架准备的,要使用yaf框架的话就得先安装php的yaf扩展支持,安装yaf扩展前需要安装好php,安装方法为:

lnmp.org官网 https://lnmp.org/install.html
lnmp 管理命令https://lnmp.org/faq/lnmp-status-manager.html
安装lnmp集成环境的步骤

1、下载安装yaf扩展库源码安装包

 官网下载页面:http://pecl.php.net/package/yaf

如图:

2、下载扩展库源码安装包

wget -c http://pecl.php.net/get/yaf-3.0.7.tgz

3、解压yaf扩展yaf-3.0.7.tgz包

tar -xzvf yaf-3.0.7.tgz
cd yaf-3.0.7

4、生成编译configure配置文件

[root@zixuephp yaf-3.0.7]# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
[root@zixuephp yaf-3.0.7]# ls
acinclude.m4    config.sub    Makefile.global  tests              yaf.c             yaf_exception.c  yaf_plugin.h    yaf_router.h
aclocal.m4      configure     missing          views              yaf_config.c      yaf_exception.h  yaf_registry.c  yaf_session.c
autom4te.cache  configure.in  mkinstalldirs    yaf_action.c       yaf_config.h      yaf_loader.c     yaf_registry.h  yaf_session.h
build           config.w32    php_yaf.h        yaf_action.h       yaf_controller.c  yaf_loader.h     yaf_request.c   yaf_view.c
config.guess    CREDITS       requests         yaf_application.c  yaf_controller.h  yaf_logo.h       yaf_request.h   yaf_view.hconfig.h.in     install-sh    responses        yaf_application.h  yaf_dispatcher.c  yaf_namespace.h  yaf_response.c
config.m4       LICENSE       routes           yaf_bootstrap.c    yaf_dispatcher.h  yaf.php          yaf_response.h
configs         ltmain.sh     run-tests.php    yaf_bootstrap.h    yaf.dsp           yaf_plugin.c     yaf_router.c
[root@zixuephp yaf-3.0.7]#

5、执行配置文件

[root@zixuephp yaf-3.0.7]# ./configure --with-php-config=/usr/local/php/bin/php-config

6、编译并安装

make && make install
#安装完成后会提示
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/
[root@zixuephp yaf-3.0.7]#

7、在php的配置文件中引用扩展

vim php.ini
#文件内容末尾加入
extension=yaf.so

8、重启php-fpm服务配置生效

service php-fpm restart

在安装完后通过运行php中的phpinfo()查看扩展信息,如图:

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值