Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I know this is a common problem. I googled and tried a lot but still doesn't work. "No input file specified" while calling PHP files from browser. I Installed nginx php/cgi on a fresh debian machine.

Nginx Config -

# 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 looks like this -

#!/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 shows cgi process being run by www-data -

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-data in passwd looks like this -

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

Permissions on /home/webroot

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

Permissions on /home/webroot/hey.php file

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

It still returns "No input file specified" when i access hey.php from browser.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.