Welcome! Log In Create A New Profile

Advanced

"No input file specified" on localhost

Posted by Kahhor 
"No input file specified" on localhost
October 01, 2011 12:20PM
Hello, I know that there were already multiple similar topics, but I tried all of them and nothing is working.
So the thing is that I installed nginx, php, mysql on my laptop.
The locations are:
nginx - C:\nginx
php - C:\nginx\php
mysql - C:\Program Files\MySQL\MySQL Server 5.1

Here is nginx.conf

#user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;


events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

index index.php;

#include conf/vhosts/*.conf;

server {
listen 80;
server_name mysite;

#charset koi8-r;

#access_log logs/host.access.log main;

location / {
root html/mysite/www;
index index.php index.html index.htm;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /html;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi.conf;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}


# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;

# location / {
# root html;
# index index.html index.htm;
# }
#}


# HTTPS server
#
#server {
# listen 443;
# server_name localhost;

# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;

# ssl_session_timeout 5m;

# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;

# location / {
# root html;
# index index.html index.htm;
# }
#}

}
------------
I guess the problem should be somewhere here:

location ~ \.php$ {
root /html;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi.conf;
}
I tried different options, changing position of the lines, but nothing is working.
when I run nginx in error.log it is showing this:
2011/10/01 10:12:29 [notice] 4672#4160: signal process started
when i'm trying to access the site, it is showing this in access.log:
127.0.0.1 - - [01/Oct/2011:10:13:02 -0400] "GET / HTTP/1.1" 404 36 "-" "Mozilla/5.0 (Windows NT 6.0; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1"

Please help. I don't know what to do (
Re: "No input file specified" on localhost
October 01, 2011 12:35PM
location ~ \.php$ {
root /html;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi.conf;
}
related to your doc root should be
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /html/mysite/www$fastcgi_script_name;
include fastcgi_params;
}
and also html/mysite/www should be /html/mysite/www for your location, and that path must exists obviously.
Re: "No input file specified" on localhost
October 01, 2011 01:42PM
Hi siloan,

I tried, but now it is showing:
404 Not Found
nginx/1.0.5

When I did before echo $_SERVER['DOCUMENT_ROOT'] it was showing "C:/nginx/html", but in nginx.conf if I write "html" it seems to be working.
I have question "fastcgi_param SCRIPT_FILENAME /html/mysite/www$fastcgi_script_name;", how my $fastcgi_script_name; can be in www folder, if it is in here: C:/nginx/html/conf, and all other config files of nginx are located there, same for nginx.conf.
And this one is also not working for some reason /html/mysite/www, (html/mysite/www works), maybe because it is localhost.

Thanks for helping me with this.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 137
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready