为了账号安全,请及时绑定邮箱和手机立即绑定

laravel上线之后nginx报500,什么问题?

laravel上线之后nginx报500,什么问题?

PHP
慕容3067478 2019-03-07 13:34:11
上线了项目之后,报这个错; 已经配置了storage和bootstrap文件夹的权限; 这个是.env的配置文件,应该也没有什么问题; 这个是nginx的二级域名的配置文件,截图截不全,就直接贴代码了; server { listen 80; #listen [::]:80 default_server ipv6only=on; server_name laravel.killlol.com; index index.html index.htm index.php; root /home/wwwroot/default/laravel/public; #error_page 404 /404.html; # Deny access to PHP files in specific directory #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; } # include enable-php.conf; location /nginx_status { stub_status on; access_log off; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } location ~ /.well-known { allow all; } location ~ /\. { deny all; } location /' { try_files $uri $uri/ /index.php?$query_string; } try_files $uri $uri/ @rewrite; location @rewrite { rewrite ^/(.*)$ /index.php?_url=/$1; } access_log /home/wwwlogs/access.log; } 这个是我namesilo上的解析地址; 我觉得是Nginx的解析有问题,因为跑了几次,Nginx的日志文件都没有相应的记录,是这个问题吗?求助; ps: nginx的配置文件如下; 把.env里的APP_URL的内容删掉了,但是还是不行; 最新进展 应该是Nginx配置的问题,但是我这个Nginx配置,之前在阿里云也上线过几个Laravel的项目,现在在用vultr的VPS,但是这个为什么不行了呢?求助; server { listen 80; #listen [::]:80 default_server ipv6only=on; server_name zhihu.jeffcottlu.com; index index.html index.htm index.php; root /home/wwwroot/default/laravel_zhihu/public; #error_page 404 /404.html; # Deny access to PHP files in specific directory #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; } # include enable-php.conf; location /nginx_status { stub_status on; access_log off; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } location ~ /.well-known { allow all; } location ~ /\. { deny all; } location / { try_files $uri $uri/ /index.php?$query_string; } try_files $uri $uri/ @rewrite; location @rewrite { rewrite ^/(.*)$ /index.php?_url=/$1; } access_log /home/wwwlogs/access.log; }
查看完整描述

6 回答

?
有只小跳蛙

TA贡献1824条经验 获得超8个赞

刚好我今天也遇到这个问题,我一般都会从这几个方面查找
1.文件需要读写权限
2.nginx配置错误
3.php版本不对应
你可以去php.ini把display_errors = OFF修改成On 会打印出错误信息

查看完整回答
反对 回复 2019-03-18
?
沧海一幻觉

TA贡献1824条经验 获得超5个赞

还有一种个能是需要关闭selinux (centos)

查看完整回答
反对 回复 2019-03-18
?
梵蒂冈之花

TA贡献1900条经验 获得超5个赞

500就是你代码有错 要么就php版本不兼容 和nginx没关系

查看完整回答
反对 回复 2019-03-18
  • 6 回答
  • 0 关注
  • 1448 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信