安装
通过Git下载框架代码
| - .htaccess // Rewrite rules
| - index.php // Application entry
| + static
| + css
| + js
| + img
- application/
- Bootstrap.php // Bootstrap
+ configs
+ controllers
- IndexController.php // Default controller
+ layouts
| + default
- layout.phtml // layout
+ logs //Log
+ models //Model
+ services //Service
+ views
|+ index
- index.phtml // View template for default controller
+ library
| + Star //Star Framework
服务器环境要求
PHP最低版本: 5.2+
INI配置
[production]
;bootstrap路径
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
;bootstrap类名
bootstrap.class = "Bootstrap"
权限设置
SF日志目录是需要权限设置,application/logs目录需要设置为可写入权限。
nginx rewrite规则
server {
listen 80;
server_name www.yoursf.com;
location / {
root sf_path/public;
index index.php;
if (!-e $request_filename) {
rewrite ^/(.*) /index.php/$1 last;
}
location ~* \.(js|css|png|jpg|jpeg|gif|swf|ico|html|htm)$ {
break;
}
location ~ \.php$ {
root sf_path/public;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
运行
安装完成后,你可以使用浏览器输入如下URL访问刚安装完毕的SF应用: