1. 程式人生 > >Linux下PHP7安裝yaf擴充套件

Linux下PHP7安裝yaf擴充套件

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配置檔案

[[email protected] 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
[
[email protected]
 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 [
[email protected]
 yaf-3.0.7]#


5、執行配置檔案

[[email protected] 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/


7、在php的配置檔案中引用擴充套件

extension=yaf.so


8、重啟php-fpm服務配置生效

service php-fpm restart


在安裝完後通過執行php中的phpinfo()檢視擴充套件資訊,如圖: