No input file specified,php+Nginx,报错处理


本地部署一个laravel项目的时候,一直报错 No input file specified,逐渐缩小范围,发现问题锁定在nginx的配置root地址上,观察下面两个nginx配置的root部分↓

server {
        listen       8083;
        server_name  hcidian.com;
        root   "D:\laravel\hcidian-Laravel\public";
        location / {
            try_files $uri $uri/ /index.php?$query_string;
            index  index.html index.htm index.php;
            #autoindex  on;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}


server {
        listen       8038;
        server_name  rcaselocal.com;
        root   "D:\php\rcase_backend\public";
        location / {
            try_files $uri $uri/ /index.php?$query_string;
            index  index.html index.htm index.php;
            #autoindex  on;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}

第一个可以正常访问,第二个报错,而两者的区别只有D:\laravel\hcidian-Laravel\publicD:\php\rcase_backend\public,经过多次尝试,要如下修改

D:\php\rcase_backend\public
改成
D:\php/rcase_backend\public

注意这个\r的部分,应该是被转义了,所以一直报错。