天天看點

linux php7 安裝yaf擴充

yaf擴充

是為php yaf架構準備的,要使用yaf架構就需要先安裝php的yaf擴充的支援。

安裝yaf擴充

前需要先安裝好php,安裝方法:

                lnmp環境安裝:http://zixuephp.net/article-262.html

                php7安裝:http://zixuephp.net/article-207.html

        centos中給

php7安裝yaf擴充庫

,,擴充庫安裝步驟:

        1.下載下傳yaf擴充庫源碼安裝包

            官網下載下傳頁面:http://pecl.php.net/package/yaf

  如圖:

linux php7 安裝yaf擴充

        2.下載下傳yaf擴充庫源碼安裝包

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

        3.解壓yaf擴充yaf-3.0.6.tgz包

  1. tar -xzvf yaf-3.0.6.tgz
  2. cd yaf-3.0.6

        4.生成編譯configure配置檔案

  1. [[email protected] yaf-3.0.6]# /usr/local/php/bin/phpize
  2. Configuring for:
  3. PHP Api Version:         20160303
  4. Zend Module Api No:      20160303
  5. Zend Extension Api No:   320160303
  6. [[email protected] yaf-3.0.6]# ls
  7. acinclude.m4    config.sub    Makefile.global  tests              yaf.c             yaf_exception.c  yaf_plugin.h    yaf_router.h
  8. aclocal.m4      configure     missing          views              yaf_config.c      yaf_exception.h  yaf_registry.c  yaf_session.c
  9. autom4te.cache  configure.in  mkinstalldirs    yaf_action.c       yaf_config.h      yaf_loader.c     yaf_registry.h  yaf_session.h
  10. build           config.w32    php_yaf.h        yaf_action.h       yaf_controller.c  yaf_loader.h     yaf_request.c   yaf_view.c
  11. config.guess    CREDITS       requests         yaf_application.c  yaf_controller.h  yaf_logo.h       yaf_request.h   yaf_view.h
  12. config.h.in     install-sh    responses        yaf_application.h  yaf_dispatcher.c  yaf_namespace.h  yaf_response.c
  13. config.m4       LICENSE       routes           yaf_bootstrap.c    yaf_dispatcher.h  yaf.php          yaf_response.h
  14. configs         ltmain.sh     run-tests.php    yaf_bootstrap.h    yaf.dsp           yaf_plugin.c     yaf_router.c
  15. [[email protected] yaf-3.0.6]#

         5.執行配置檔案

  1. [[email protected] yaf-3.0.6]# ./configure --with-php-config=/usr/local/php/bin/php-config

         6.編譯并安裝

  1. make && make install
  2. #安裝完成後會提示
  3. Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/
  4. [[email protected] yaf-3.0.6]#

         7.在PHP的配置檔案中引用擴充

  1. vim php.ini
  2. #檔案内容末尾加入
  3. extension=yaf.so

        8.重新開機php-fpm服務擴充生效

  1. service php-fpm restart

        在安裝完後通過運作php中的phpinfo()檢視擴充資訊,如圖:

linux php7 安裝yaf擴充