Home > Database > Mysql Tutorial > Yaf installation_configure yaf rewrite rules_generate the simplest yaf project

Yaf installation_configure yaf rewrite rules_generate the simplest yaf project

php是最好的语言
Release: 2018-08-04 14:33:58
Original
2090 people have browsed it

Yaf的安装

一、下载yaf安装包

  • pecl,进入php官方扩展模块官网,yaf被收录在其中

  • 搜索:yaf

  • yaf PHP Framework in PHP extension,即可下载各种版本的yaf安装包。

二、解压并安装

  • tar -zxvf yaf-3.0.5

    • 我下载的版本是3.0.5

  • cd yaf-3.0.5

  • your/phpize/path

    • 如果你不知道你的phpize的路径,可以find / -name 'phpize'

  • ./configure --with-php-config=your/php-config/path

    • 如果你不知道你的php-config路径,同上

  • make

  • make install

  • vim your/php.ini/path

    • 添加三行:

    • [Yaf]

    • extension=yaf.so

    • yaf.environ="product"

  • systemctl start php-fpm.service

    • 重启php-fpm

三、 配置yaf的rewrite规则

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

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

  • wget https://github.com/laruence/yaf/archive/master.zip

  • unzip master.zip

  • cd yaf-master

    cd tools/cg

    • 可以看到yaf_cg,可以通过yaf_cg生成一个最简单的yaf项目

  • php yaf_cg project_name

  • cd output

    • 即可看到你生成的项目

相关文章:

PHP Yaf框架的简单安装使用教程(推荐),yaf安装使用

配置Yaf

The above is the detailed content of Yaf installation_configure yaf rewrite rules_generate the simplest yaf project. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template