php - Nginx '未指定输入文件。' 使用 php71 的 laravel 项目出错
问题描述
这是我的 error.log 中出现的内容
1498#0:* 1 FastCGI 在标准错误中发送:“PHP 消息:PHP 警告:未知:无法打开流:第 0 行的未知中不允许操作无法打开主脚本:/var/www/public/index.php(不允许操作)”,同时从上游读取响应头,客户端:127.0.0.1,服务器:example.com,请求:“GET / HTTP/1.1”,上游:“fastcgi://127.0.0.1:9000”,主机: “example.com”
我对 /var/www/public/index.php 的许可是
-rwxrwxrwx 1 用户员工 1782 3 月 15 日 12:17 index.php
我的服务器配置
server {
listen 80;
listen [::]:80;
server_name example.com;
client_max_body_size 100M;
root /var/www/public;
index index.php index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
}
解决方案
推荐阅读
- html - 网络托管 public_html 文件夹中的图像未显示
- boto3 - AWS SSM 参数 GET 使用 KMS 解密
- docusignapi - DocuSign API - 如何让签名者收到已签名文档的副本
- linux - 有没有一种简单的方法可以按目录中的文件类型汇总磁盘使用情况?
- java - 如何在 DynamoDB 中存储对象数组
- hyperledger-fabric - 通道 MSP(cred 文件)在 Hyperledger Fabric 节点上本地存储在哪里?
- macos - Mac OS High Sierra 日志显示位置
- javascript - 使用 Promise 递归
- php - PHP 函数 (globals/locals) 中的变量是如何继承的?
- python-3.x - MNIST 数据的神经网络中的错误正在停止到一个恒定值