nginx 跑php时找不到文件报no input file specified.

是用fast-cgi来解析PHP文档吧?如果是,你的配置文件中应该有一段类似的配置信息

        location ~ .*\.php$ {
                fastcgi_pass phpsrv;
                include        fastcgi_params;
                fastcgi_param SCRIPT_FILENAME    $document_root$fastcgi_script_name;
                fastcgi_index index.php;
    }

其中 $document_root表示你网站的主目录,提示错误就是说在这个主目录下找不到对应的PHP文件, 如果你的主目录配置正确,但仍然报这个错,你可以把这个参数直接用绝对路径替换掉,比如:/var/www/html/[you project folder], 这样应该就不会再出现这个错误了。

原文地址:https://www.cnblogs.com/liqiu/p/2716810.html