所以,过去两天我一直在试图安装Laravel。我是这个框架的新手,但想学习它。我在Nginx服务器上使用composer安装它。之后我改变了Nginx配置文件。现在,我得到的只是一个空白页面而已。我还更改了app/storage
的权限。
您可以在下面找到我的配置文件:
server {
server_name website.com www.website.com;
root /var/www/website.com/htdocs/public/;
index index.php index.html;
#browse folders if no index file
autoindex on;
# serve static files directly
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
expires max;
}
# removes trailing slashes (prevents SEO duplicate content issues)
if (!-d $request_filename)
{
rewrite ^/(.+)/$ /$1 permanent;
}
# enforce NO www
if ($host ~* ^www\.(.*))
{
set $host_without_www $1;
rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent;
}
# canonicalize codeigniter url end points
# if your default controller is something other than "welcome" you should change the following
if ($request_uri ~* ^(/lobby(/index)?|/index(.php)?)/?$)
{
rewrite ^(.*)$ / permanent;
}
# removes trailing "index" from all controllers
if ($request_uri ~* index/?$)
{
rewrite ^/(.*)/index/?$ /$1 permanent;
}
# unless the request is for a valid file (image, js, css, etc.), send to bootstrap
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}
# catch all
error_page 404 /index.php;
location ~ \.php$ {
try_files $uri $uri/ /index.php?$args;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#include fastcgi_params;
include /etc/nginx/fastcgi_params;
}
}
答案 0 :(得分:-1)
检查www-data
用户
sudo chown -R :www-data /your/location
检查文档根路径
再次检查此部分:location ~ \.php$
...
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
检查错误日志
取消注释&在;cgi.fix_pathinfo=1
cgi.fix_pathinfo=0
修改为php.ini
使用Homestead&锻造