## 環境要求
>[info] PHP 版本 >= 5.4
> pdo 擴展
> redis 擴展 (可選)
> memcache 擴展 (可選)
> 如果是Apache,需開啟mod_rewrite
## 下載ExpressPHP
到 `GitHub` 下載最新版本
[ExpressPHP 最新源碼](https://github.com/onanying/ExpressPHP-V1)
[ExpressPHP 發行版本下載](https://github.com/onanying/ExpressPHP-V1/releases)
[ExpressPHP demo下載](https://github.com/onanying/ExpressPHP-V1-Demo)
## 安裝
只需要將下載的文件解壓后放入你的 WEB 環境就可以了,將Apache/Nginx的root目錄設置為框架的 `public` 目錄
~~~
<VirtualHost *:80>
DocumentRoot "\data\www\ExpressPHP\application\public"
ServerName www.t.com
</VirtualHost>
~~~
## URL重寫
框架的路由是 `PATHINFO` 實現的,需要通過URL重寫去掉URL中的 `index.php`。
### [ Apache ]
1. httpd.conf配置文件中加載了mod_rewrite.so模塊
2. AllowOverride None 將None改為 All
### [ Nginx ]
在Nginx.conf中配置轉發規則
~~~
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ index.php/$1 last;
break;
}
}
~~~