fastadmin是一个可以用于快速开发后台的框架,写个东东记录一下以防老年痴呆

我这里用的环境是ubuntu 16.04,使用的是官方推荐的git安装

 

一路按照官方教程里的步骤安装下来就好了,不过要先安装上node和npm

apt-get install npm
apt-get install nodejs-legacy
npm install bower -g

然后我们配置一下nginx

server{
    listen 82;
    server_name 127.0.0.1 localhost;
    root /home/fast_web/fastadmin/public;
    location / {
        index index.html index.php index.htm;
        if (!-e $request_filename){
                rewrite  ^(.*)$  /index.php?s=$1  last;
                break;
        }
    }

    location ~ \.php$ {
        fastcgi_pass   unix:/run/php/php7.0-fpm.sock;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_index  index.php;
        fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
        fastcgi_param  PATH_INFO  $fastcgi_path_info;
        fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
        include        fastcgi_params;
    }
}

同时请设置php.ini里面的cgi.fix_pathinfo=1噢

 

然后我们就打开我们的fastadmin后台看看了,但是显然不会那么顺利的了

fastadmin后台ubuntu搭建_配置文件

这个时候我们需要先打开fastadmin自带的debug模式来看看是出了什么问题

进入fastadmin的目录下,在application/下就有一个config.ini 的配置文件

// 应用调试模式
    'app_debug'              => Env::get('app.debug', true),

把默认的false改成true即可刷新页面重试

fastadmin后台ubuntu搭建_git安装_02

这样一下子就知道是因为某个文件夹权限不足导致了,我们将runtime这个文件夹直接给775权限之后就可以成功登陆上去啦