https://github.com/liburdi/hiphp
100行代码学会PHP实现web框架的原理 | Learn the principles of building a web framework with just 100 lines of PHP code.
https://github.com/liburdi/hiphp
php php-framework
Last synced: 20 days ago
JSON representation
100行代码学会PHP实现web框架的原理 | Learn the principles of building a web framework with just 100 lines of PHP code.
- Host: GitHub
- URL: https://github.com/liburdi/hiphp
- Owner: liburdi
- Created: 2018-07-22T11:05:37.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-11-21T06:19:28.000Z (over 2 years ago)
- Last Synced: 2025-07-31T11:17:11.423Z (11 months ago)
- Topics: php, php-framework
- Language: PHP
- Homepage:
- Size: 25.4 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### 用途
- 了解框架的实现
### 安装
> HiPHP1.0的运行环境要求PHP7.1+。
~~~
composer create-project liburdi/hiphp hp
~~~
* 指定版本安装
~~~
composer create-project liburdi/hiphp=v1.0.0 hp
~~~
* nginx
~~~
server{
listen 80;
server_name localhost;
index index.html index.php;
default_type text/html;
charset utf-8;
root /wwwroot/hiphp;
client_max_body_size 256m;
location / {
try_files $uri @rewrite;
}
location @rewrite {
set $static 0;
if ($uri ~ \.(css|js|jpg|jpeg|png|gif|ico|woff|eot|svg|css\.map|min\.map)$) {
set $static 1;
}
if ($static = 0) {
rewrite ^/(.*)$ /index.php?s=/$1;
}
}
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
~~~
* 访问127.0.0.1