PHPackages                             yeszao/fastphp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. yeszao/fastphp

ActiveProject[Framework](/categories/framework)

yeszao/fastphp
==============

Simple and lightweight PHP framework

v2.1(8y ago)320505123[2 issues](https://github.com/yeszao/fastphp/issues)MITPHPPHP &gt;=5.4.0

Since Dec 13Pushed 1y ago24 watchersCompare

[ Source](https://github.com/yeszao/fastphp)[ Packagist](https://packagist.org/packages/yeszao/fastphp)[ Docs](http://www.awaimai.com)[ RSS](/packages/yeszao-fastphp/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (5)Dependencies (1)Versions (3)Used By (0)

FastPHP
=======

[](#fastphp)

[![Build Status](https://camo.githubusercontent.com/66490c78ce6bfdff200a9411600876863a302b889a5213a6b7543aaaaa7f353a/68747470733a2f2f7472617669732d63692e6f72672f7965737a616f2f666173747068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/yeszao/fastphp)[![Latest Stable Version](https://camo.githubusercontent.com/26f992398eeea560aa4a2f29c44aca4dab4a81597eac06317019e82d8884149f/68747470733a2f2f706f7365722e707567782e6f72672f7965737a616f2f666173747068702f762f737461626c65)](https://packagist.org/packages/yeszao/fastphp)[![Total Downloads](https://camo.githubusercontent.com/7efb543c3a1de71748a4e0aa5befae63ce56b993c6947624ae58a19e0c254f7a/68747470733a2f2f706f7365722e707567782e6f72672f7965737a616f2f666173747068702f646f776e6c6f616473)](https://packagist.org/packages/yeszao/fastphp)[![Latest Unstable Version](https://camo.githubusercontent.com/086b95d9024c77213b0668de4c359d0a1ec652b54c3830a0928307916700181b/68747470733a2f2f706f7365722e707567782e6f72672f7965737a616f2f666173747068702f762f756e737461626c65)](https://packagist.org/packages/yeszao/fastphp)[![License](https://camo.githubusercontent.com/fb3c6f8cc1525a9369d595920511a5688f6608325e672399a03e82eb39a9fa91/68747470733a2f2f706f7365722e707567782e6f72672f7965737a616f2f666173747068702f6c6963656e7365)](https://packagist.org/packages/yeszao/fastphp)

简述
--

[](#简述)

**fastphp**是一款简单的PHP MVC框架，目的是方便学习《手把手编写自己的PHP MVC框架》教程的同学下载源代码，详细介绍请参考网站： 。

要求：

- PHP 5.4.0+

目录说明
----

[](#目录说明)

```
project                 根目录
├─app                   应用目录
│  ├─controllers        控制器目录
│  ├─models             模块目录
│  ├─views              视图目录
├─config                配置文件目录
├─fastphp               框架核心目录
├─static                静态文件目录
├─index.php             入口文件

```

使用
--

[](#使用)

### 1.安装

[](#1安装)

主要介绍通过composer和git两种安装方法，选择其一即可。

**方法1**：Composer安装（推荐）

```
composer create-project yeszao/fastphp project --no-dev

```

其中，`--no-dev`表示不安装-dev依赖包（PHPUnit）。

**方法2**：Github安装：

```
git clone https://github.com/yeszao/fastphp.git project

```

> 说明：这两个命令都会创建并将代码安装到`project`目录。

### 2. 创建数据库

[](#2-创建数据库)

在数据库中创建名为 project 的数据库，并插入两条记录，命令：

```
CREATE DATABASE `project` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `project`;

CREATE TABLE `item` (
    `id` int(11) NOT NULL auto_increment,
    `item_name` varchar(255) NOT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

INSERT INTO `item` VALUES(1, 'Hello World.');
INSERT INTO `item` VALUES(2, 'Lets go!');

```

### 3.修改数据库配置文件

[](#3修改数据库配置文件)

打开配置文件 config/config.php ，使之与自己的数据库匹配

```
$config['db']['host'] = 'localhost';
$config['db']['username'] = 'root';
$config['db']['password'] = '123456';
$config['db']['dbname'] = 'project';

```

### 4.配置Nginx或Apache

[](#4配置nginx或apache)

在Apache或Nginx中创建一个站点，把 project 设置为站点根目录（入口文件 index.php 所在的目录）。

然后设置单一入口， Apache服务器配置：

```

    # 打开Rerite功能
    RewriteEngine On

    # 如果请求的是真实存在的文件或目录，直接访问
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # 如果访问的文件或目录不是真事存在，分发请求至 index.php
    RewriteRule . index.php

```

Nginx服务器配置：

```
location / {
    # 重新向所有非真实存在的请求到index.php
    try_files $uri $uri/ /index.php$args;
}

```

### 5.测试访问

[](#5测试访问)

然后访问站点域名： 就可以了。

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3076d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a5278d1bc1dc3f42f355d567b0faf9d9be3a5894c80f9f40cdbeb3d920ab821?d=identicon)[yeszao](/maintainers/yeszao)

---

Top Contributors

[![garylab](https://avatars.githubusercontent.com/u/3072379?v=4)](https://github.com/garylab "garylab (83 commits)")[![lixworth](https://avatars.githubusercontent.com/u/22554300?v=4)](https://github.com/lixworth "lixworth (2 commits)")

---

Tags

frameworkmvcfastphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yeszao-fastphp/health.svg)

```
[![Health](https://phpackages.com/badges/yeszao-fastphp/health.svg)](https://phpackages.com/packages/yeszao-fastphp)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
