代码之家  ›  专栏  ›  技术社区  ›  Aiden

NGINX-未指定输入文件

  •  3
  • Aiden  · 技术社区  · 7 年前

    只是想在我发布这个问题之前让大家知道我查过了

    http://example.com/ - first app
    http://example.com/learn - second app
    

    问题是:

    主应用程序工作正常,但学习应用程序显示一个白色页面,“没有指定输入文件”。

    /srv/users/serverpilot/apps/main/public/index.php
    /srv/users/serverpilot/apps/learn/public/index.php
    

    我的NGINX配置:

    root "/srv/users/serverpilot/apps/main/public";
    
    location ^~ /learn {
        root    "/srv/users/serverpilot/apps";
        try_files   $uri /learn/public/index.php?$query_string;
        location ~ \.php$ {
            add_header X-debug-message $document_root$fastcgi_script_name always;
            include       fastcgi_params;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_pass  unix:/srv/users/serverpilot/run/learn.php-fpm.sock;
        }
    }
    
    location / {
        try_files     $uri $uri/ /index.php?$args;
        location ~ \.php$ {
            include       fastcgi_params;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_pass  unix:/srv/users/serverpilot/run/main.php-fpm.sock;
            try_files     $uri =404;
        }
     }
    

    1. 我知道fastcgi\u pass套接字正在工作,因为我
    2. 我添加了 add_header X-debug-message$document\u root$fastcgi\u script\u name“始终; SCRIPT\u文件名为 /srv/users/serverpilot/apps/learn/public/index。php存在,正是我试图运行的文件。
    1 回复  |  直到 7 年前
        1
  •  2
  •   Aiden    7 年前

    哦,天哪!多么疯狂的狩猎啊!

    fastcgi_参数 您还可以设置 php\u值[doc\u根] 这将覆盖您的 $document\u根 通常用于 参数所以请检查您的 php。ini公司 php\u值[doc\u根]