Welcome! Log In Create A New Profile

Advanced

nginx No input file specified.

Posted by blo 
blo
nginx No input file specified.
September 20, 2009 01:43PM
Hi,

I'm new to Nginx and I'm trying to setup Nginx, FASTCGI and Drupal.

I'm using OpenVZ environment running Archlinux template and compiled Nginx from source using the latest stable release with default options. (Nginx 0.7.62)

Next I compiled spawn-cgi from source with the default options using the latest release. (spawn-fcgi v1.6.2 (ipv6) )

I installed PHP from the Arch extra repository. (5.2.10-3) I checked the PKGBUILD and it has FASTCGI support.

Downloaded the latest release of Drupal 6 and extracted to the target document root directory ( /var/www) and gave write permission to settings.php as described in the Drupal offical tutorial.

I spawn the fastcgi like this:

/usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u http -g http -f /usr/bin/php-cgi -P /var/run/fastcgi-php.pid

Spawn-fcgi spawns it successfully: spawn-fcgi: child spawned successfully: PID: 23465

Privileges:
--------------
drwxrwxr-x 9 http http 4096 2009-09-20 17:39 www
-rw-r--r-- 1 http http 43058 2009-09-16 21:34 CHANGELOG.txt
-rw-r--r-- 1 http http 988 2009-09-14 14:50 COPYRIGHT.txt
-rw-r--r-- 1 http http 1308 2007-11-19 20:53 INSTALL.mysql.txt
-rw-r--r-- 1 http http 1075 2007-11-26 17:36 INSTALL.pgsql.txt
-rw-r--r-- 1 http http 15646 2008-07-09 21:15 INSTALL.txt
-rw-r--r-- 1 http http 18048 2009-01-06 18:27 LICENSE.txt
-rw-r--r-- 1 http http 1924 2009-04-29 19:15 MAINTAINERS.txt
-rw-r--r-- 1 http http 5002 2008-01-04 17:15 UPGRADE.txt
-rw-r--r-- 1 http http 262 2006-08-09 09:42 cron.php
drwxr-xr-x 2 http http 4096 2009-09-16 21:40 includes
-rw-r--r-- 1 http http 980 2007-12-26 09:46 index.php
-rw-r--r-- 1 http http 46926 2009-04-27 12:50 install.php
drwxr-xr-x 3 http http 4096 2009-09-16 21:40 misc
drwxr-xr-x 35 http http 4096 2009-09-16 21:40 modules
drwxr-xr-x 3 http http 4096 2009-09-16 21:40 profiles
-rw-r--r-- 1 http http 1590 2008-12-10 21:12 robots.txt
drwxr-xr-x 2 http http 4096 2009-09-16 21:40 scripts
drwxr-xr-x 4 http http 4096 2009-09-16 21:40 sites
drwxr-xr-x 7 http http 4096 2009-09-16 21:40 themes
-rw-r--r-- 1 http http 896 2009-09-20 17:39 todolist.html
-rw-r--r-- 1 http http 25457 2009-03-30 13:15 update.php
-rw-r--r-- 1 http http 352 2005-12-10 20:26 xmlrpc.php

Ps aux:
root 23482 0.0 0.0 4008 540 ? S<s 19:27 0:00 nginx: master process nginx
http 23483 0.0 0.1 4176 1176 ? S< 19:27 0:00 nginx: worker process
http 23465 0.0 0.4 14268 3780 ? S<s 19:23 0:00 /usr/bin/php-cgi

I attached the necessary configuration files and logs. Any idea regarding the above problem is appreciated.

Greeting
Attachments:
open | download - nginx_report.txt (48.9 KB)
Re: nginx No input file specified.
September 20, 2009 04:10PM
Looking at this section:

[code]
location ~ \.php$ {
root /var/www;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_pass localhost:9000; # port where FastCGI processes were spawned
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html/$fastcgi_script_name; # same path as above

}
[/code]

I'm a little confused. You define a document root at /var/www but "fastcgi_param SCRIPT_FILENAME" in a different location.

Try:

[code]
location ~ \.php$ {
root /path/to/document/root;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_pass localhost:9000; # port where FastCGI processes were spawned
fastcgi_index index.php;
}
[/code]

And add the following to the default fastcgi_params file:

[code]
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
[/code]

--
Jim Ohlstein
blo
Re: nginx No input file specified.
September 20, 2009 04:29PM
Yes i just noticed and modified that section like this:

location ~ \.php$ {
root /var/www;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_pass localhost:9000; # port where FastCGI processes were spawned
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name; # same path as above

}

I already tried like this:

location ~ \.php$ {
root /var/www;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_pass localhost:9000; # port where FastCGI processes were spawned
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html/$fastcgi_script_name; # same path as above

}

But no joy.

fstcgi-params:
-------------------
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;

I think It is all the same if I specify fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; in the php section or in fastcgi_params. Thought I tried the way you advised still the same error.

Greetings
Re: nginx No input file specified.
September 20, 2009 06:07PM
My suggestions:

[list=1]
[*] Check the permissions all along the path to the script.
[*]What do the logs say now?
[*]Humor me and try doing it *exactly* as I suggested.
[/list]

--
Jim Ohlstein
blo
Re: nginx No input file specified.
September 21, 2009 02:08AM
I added
[code]fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;[/code]

to fscgi_params.

And using this PHP configuration:
--------------------------------------------
[code]
location ~ \.php$ {
root /var/www;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_pass localhost:9000; # port where FastCGI processes were spawned
fastcgi_index index.php;
}
[/code]


As you suggested. Sorry for that I just applied it.
Log:
====
Error.log:
------------
2009/09/21 07:58:20 [notice] 17084#0: using the "epoll" event method
2009/09/21 07:58:20 [notice] 17084#0: nginx/0.7.62
2009/09/21 07:58:20 [notice] 17084#0: built by gcc 4.4.1 (GCC)
2009/09/21 07:58:20 [notice] 17084#0: OS: Linux 2.6.26-2-openvz-686
2009/09/21 07:58:20 [notice] 17084#0: getrlimit(RLIMIT_NOFILE): 1024:1024
2009/09/21 07:58:20 [notice] 17085#0: start worker processes
2009/09/21 07:58:20 [notice] 17085#0: start worker process 17086
2009/09/21 07:58:45 [error] 17086#0: *1 open() "/var/www/favicon.ico" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:5001"
2009/09/21 07:58:48 [error] 17086#0: *1 open() "/var/www/favicon.ico" failed (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:5001"

Access.log:
---------------
127.0.0.1 - - [21/Sep/2009:07:58:45 +0200] "GET /favicon.ico HTTP/1.1" 404 169 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) Gecko/20090913 Shiretoko/3.5.3"
127.0.0.1 - - [21/Sep/2009:07:58:48 +0200] "GET /favicon.ico HTTP/1.1" 404 169 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) Gecko/20090913 Shiretoko/3.5.3

Sorry but I don't understand which script's path should I check.

blo
blo
Re: nginx No input file specified.
September 21, 2009 05:44AM
After some tweaking the problem came to the surface. It was the "open_basedir" option in php.ini. You should point that parameter to your document root directory like /var/www or /src/http. It should be the same as the "root" option in this section:

[code]
location ~ \.php$ {
[b]root /var/www;[/b]
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_pass localhost:9000; # port where FastCGI processes were spawned
fastcgi_index index.php;
}
[/code]


Thanks for the help.

blo
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 125
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready