Yaf的安装_配置yaf的rewrite规则_生成一个最简单的yaf项目

来源:这里教程网 时间:2026-02-28 11:54:53 作者:

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;
}

四、生成一个最简单的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

相关推荐