LNMP1.4 搭建laravel总是不成功
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 目前无法处理此请求。
HTTP ERROR 500
目录文件已经给了777,防火墙已经关闭,laravel不存在任何错误,这个问题已经请教很多人,还是无法解决,希望大哥给看看
问题只存在laravel,v.conf指向其他目录index.html index.php都可以 首先,用lnmp vhost add 直接创建并添加上laravel的伪静态就可以了,别去加自己认为的pathinfo等其他乱七八糟的配置
其次,php报500错误,官网常见问题有说明,开php错误日志就有明确原因,官网搜索:移除防跨目录设置
页:
[1]