php laravel框架失败_急急急!!!ubuntu+laravel+nginx安装完成后,请求laravel框架失败...

博主在Ubuntu上安装Laravel、Nginx和PHP后遇到框架无法访问的问题。尽管每个组件安装成功,但通过IP访问只显示Nginx默认页面。配置文件中try_files指令似乎未能正确工作,怀疑可能与权限设置有关。已尝试调整fpm.conf用户和组,以及laravel目录权限,但问题依旧。目前定位到try_files失败可能是关键,亟待解决。
摘要由CSDN通过智能技术生成

这个问题困扰我好几天了。

按照网上的步骤在ubuntu中安装了+laravel+nginx+php,每个步骤安装成功,

但是请求不到laravel框架。输入http://ip/,没有预期的结果。

下面给出关键配置:

1、nginx配置:

worker_processes 1;

events {

worker_connections 1024;

}

http {

include mime.types;

default_type application/octet-stream;

sendfile on;

keepalive_timeout 65;

server {

listen 80;

server_name ip;

root /opt/www/laravel/public;

index index.html index.php;

location / {

try_files $uri $uri/ /index.php$query_string;

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root html;

}

location ~ .php$ {

root html;

fastcgi_pass unix:/opt/run/php5-fpm.sock;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

}

浏览器输入http://ip/,显示的是/usr/local/nginx/html/index.php的内容。

2、经过调试,是try_files失败,估计可能是权限问题,权限设置:

(1)、fpm.conf中指定的用户和用户组:

user = skycity

group = panda

(2)、指定/opt/www/laravel/目录权限:

chgrp -R panda /opt/www/laravel

chown -R skycity:panda /opt/www/laravel

结果try_files还是失败!

请问这是什么原因呢?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值