unable open file php,linux 使用lnmp 报Unable to open primary script

这篇博客主要讨论了一个Nginx站点在运行时遇到的权限问题,错误日志显示无法访问指定的PHP文件,如1.html和2.php,提示'Permission denied'和'No such file or directory'。博主尝试了修改权限,但问题依然存在。内容可能涉及如何排查和解决Nginx与PHP-FPM的配置错误,以及用户和组设置对文件访问的影响。

报的错误

2018/10/12 16:33:44 [crit] 5351#0: *121 stat() "/root/wwwroot/test/1.html" failed (13: Permission denied), client: 127.0.0.1, server: input.cc, request: "GET /1.html HTTP/1.1", host: "input.cc"

2018/10/12 16:33:44 [error] 5351#0: *121 FastCGI sent in stderr: "Unable to open primary script: /root/wwwroot/test/index.php (No such file or directory)" while reading response header from upstream, client: 127.0.0.1, server: input.cc, request: "GET /1.html HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "input.cc"

2018/10/12 16:33:44 [info] 5351#0: *121 client 127.0.0.1 closed keepalive connection

2018/10/12 16:33:47 [error] 5351#0: *123 FastCGI sent in stderr: "Unable to open primary script: /root/wwwroot/test/2.php (No such file or directory)" while reading response header from upstream, client: 127.0.0.1, server: input.cc, request: "GET /2.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "input.cc"

2018/10/12 16:33:47 [info] 5351#0: *123 client 127.0.0.1 closed keepalive connection

nginx 站点的配置

bVbh5s7?w=675&h=598

nginx, php-fpm使用用户和组为www

bVbh5td?w=1117&h=322

站点目录与文件的权限

bVbh5tw?w=577&h=215

无法访问配置的站点

bVbh5ty?w=631&h=101

nginx监听到的错误

bVbh5tA?w=1523&h=548

本以为是权限问题,我也设置了权限,还是报错.不知道什么问题.

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值