VPS侦探论坛

 找回密码
 注册
查看: 2943|回复: 1

LNMP1.4 搭建laravel总是不成功

[复制链接]
发表于 2018-8-24 17:07:46 | 显示全部楼层 |阅读模式

nginx配置文件:server
    {
        listen 80 default_server;
        #listen [::]:80 default_server ipv6only=on;
        server_name _;
        index index.html index.htm index.php;
        root  /home/wwwroot/default;

        #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;
        }

        access_log  /home/wwwlogs/access.log;
    }
include vhost/*.conf;
}





引入vhost中v.com
  server {
          listen 80;
          server_name www.a.com;
          index index.html index.htm index.php;
          root /home/wwwroot/shop/public;

          include enable-php.conf;

  

   location / {
            try_files $uri $uri/ /index.php?$query_string;
        }

location ~ \.php$ {

try_files $uri /index.php =404;

fastcgi_split_path_info ^(.+\.php)(/.+)$;

fastcgi_pass unix:/tmp/php-cgi.sock;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}
  }




报错:
该网页无法正常运作www.a.com 目前无法处理此请求。

[size=0.8em]HTTP ERROR 500



目录文件已经给了777,防火墙已经关闭,laravel不存在任何错误,这个问题已经请教很多人,还是无法解决,希望大哥给看看


问题只存在laravel,v.conf指向其他目录index.html index.php都可以
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2018-8-24 20:04:53 | 显示全部楼层


首先,用lnmp vhost add 直接创建并添加上laravel的伪静态就可以了,别去加自己认为的pathinfo等其他乱七八糟的配置
其次,php报500错误,官网常见问题有说明,开php错误日志就有明确原因,官网搜索:移除防跨目录设置
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-23 19:20 , Processed in 0.024839 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表