首页 > 解决方案 > 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;
        }
}

标签: phpnginx

解决方案


推荐阅读