NGinx – PHP / CGI – 没有指定input文件

我知道这是一个普遍的问题。 我GOOGLEsearch了很多,但仍然无法正常工作。 从浏览器调用PHP文件时,“没有指定input文件”。 我在一台新的debian机器上安装了nginx php / cgi。

Nginxconfiguration –

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/webroot$fastcgi_script_name; include /etc/nginx/fastcgi_params; } 

/ usr / bin / php-fastcgi看起来像这样 –

 #!/bin/bash FASTCGI_USER=www-data FASTCGI_GROUP=www-data ADDRESS=127.0.0.1 PORT=9000 PIDFILE=/var/run/php-fastcgi/php-fastcgi.pid CHILDREN=3 PHP5=/usr/bin/php5-cgi /usr/bin/spawn-fcgi -a $ADDRESS -p $PORT -P $PIDFILE -C $CHILDREN -u $FASTCGI_USER -g $FASTCGI_GROUP -f $PHP5 

ps aux显示由www-data运行的cgi进程 –

 root 1993 0.0 0.0 64324 1248 ? Ss 04:05 0:00 nginx: master process /usr/sbin/nginx root 1995 0.0 0.0 64660 2436 ? S 04:05 0:00 nginx: worker process www-data 2009 0.0 0.0 73640 3792 ? S 04:05 0:00 /usr/bin/php5-cgi www-data 2010 0.0 0.0 73640 3796 ? S 04:05 0:00 /usr/bin/php5-cgi www-data 2011 0.0 0.0 73640 3148 ? S 04:05 0:00 /usr/bin/php5-cgi 

www中的数据在passwd看起来像这样 –

 www-data:x:33:33:www-data:/home/webroot:/bin/sh 

/ home / webroot上的权限

 drwxrwxr-x 3 www-data www-data 4096 Dec 13 04:01 webroot 

/home/webroot/hey.php文件的权限

 -rwxr-xr-x 1 www-data www-data 25 Dec 13 03:46 hey.php 

当我从浏览器访问hey.php时,它仍然返回“没有指定input文件”。