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
如圖:

2.下載下傳yaf擴充庫源碼安裝包
- wget -c http://pecl.php.net/get/yaf-3.0.6.tgz
3.解壓yaf擴充yaf-3.0.6.tgz包
- tar -xzvf yaf-3.0.6.tgz
- cd yaf-3.0.6
4.生成編譯configure配置檔案
- [[email protected] yaf-3.0.6]# /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.6]# 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.h
- config.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.6]#
5.執行配置檔案
- [[email protected] yaf-3.0.6]# ./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-20160303/
- [[email protected] yaf-3.0.6]#
7.在PHP的配置檔案中引用擴充
- vim php.ini
- #檔案内容末尾加入
- extension=yaf.so
8.重新開機php-fpm服務擴充生效
- service php-fpm restart
在安裝完後通過運作php中的phpinfo()檢視擴充資訊,如圖: