Yaf的安装

Yaf的安装

1、下载yaf安装包

  • pecl,进入php官方扩展模块官网,yaf被收录在其中
  • 搜索:yaf
  • yaf PHP Framework in PHP extension,便可下载各类版本的yaf安装包。

2、解压并安装

  • tar -zxvf yaf-3.0.5php

    • 我下载的版本是3.0.5
  • cd yaf-3.0.5
  • your/phpize/pathnginx

    • 若是你不知道你的phpize的路径,能够find / -name 'phpize'
  • ./configure --with-php-config=your/php-config/pathgit

    • 若是你不知道你的php-config路径,同上
  • make
  • make install
  • vim your/php.ini/pathgithub

    • 添加三行:
    • [Yaf]
    • extension=yaf.so
    • yaf.environ="product"
  • systemctl start php-fpm.servicevim

    • 重启php-fpm

3、 配置yaf的rewrite规则

if (!-e $request_filename) {
    rewrite ^/(.*) /index.php?$1 last;
}

4、生成一个最简单的yaf项目

  • wget https://github.com/laruence/yaf/archive/master.zip
  • unzip master.zip
  • cd yaf-master
  • cd tools/cgphp-fpm

    • 能够看到yaf_cg,能够经过yaf_cg生成一个最简单的yaf项目
  • php yaf_cg project_name
  • cd outputcode

    • 便可看到你生成的项目
相关文章
相关标签/搜索