Welcome! Log In Create A New Profile

Advanced

Newbie need help about config - strange error

Posted by marring 
Newbie need help about config - strange error
May 06, 2011 03:46AM
Dear all,

This is my config file:

#user nobody;
worker_processes 6;

error_log /var/log/nginx_error.log debug;

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"';

gzip on;
gzip_comp_level 2;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

sendfile on;
tcp_nopush on;
tcp_nodelay on;

keepalive_timeout 75 20;

server {
listen 8080;
server_name myserver.com;

error_log /var/log/nginx/myserver.error.log;

index index.php index.html index.htm;

root /home/forum/public_html/;

location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}
}
}

Very simple, but the result is: "No input file specified."

Both script phpinfo() and forum script gives the same result. The forum is vbulletin, and I run nginx 1.0.1 + php-fpm (5.3.6) on linux platform (centos), build all by myself.

When I modify some thing, I don't remember, but with phpinfo() script is ok. But the forum script give a blank page. I can not find any place to trace error.

I read the manual on nginx.org very carefully, and build the simple config for my site. Please help me... the apache runs very slow and I want to try new platform for web server.
Re: Newbie need help about config - strange error
May 06, 2011 06:09AM
I found something new, but error still there!

First, because too hard to find the error when using php-fpm. I compiled again to php-cgi. And I found something:

- if running php-cgi in console "php-cgi -b 127.0.0.1:9000", and check result. IT RUNS. wow...
- but when I built script to run as service by compile start-stop-daemon for CentOS. The init script here: http://wiki.nginx.org/PHPFcgiExample. After starting service php-cgi, there are 15 php-cgi running and waiting for nginx. But when check the result, old error appears: "No input file specified."

I'm not an expert. But I think that the error maybe in the poll or queue between nginx and php-cgi/php-fpm.

Please help me!



Edited 1 time(s). Last edit at 05/06/2011 06:13AM by marring.
Re: Newbie need help about config - strange error
May 06, 2011 08:41AM
Continue strange error:

I change to UNIX socket, following the advice from http://wiki.nginx.org/PHPFcgiExample:

Using a Unix Socket

The above example binds PHP to run on port 9000 on localhost (127.0.0.1:9000). This is the most common and easiest to understand option. Unix sockets are however much better. To use them you need to do two things.

In the above script change "BIND=127.0.0.1:9000" to "BIND=/tmp/php.socket"
In the Nginx config change "fastcgi_pass 127.0.0.1:9000;" to ""fastcgi_pass unix:/tmp/php.socket;"

And restart both php-cgi and nginx. Error is still there: No input file specified.

Really hard to understand, I can not fix error by myself. Please help! URGENT...
Re: Newbie need help about config - strange error
May 06, 2011 10:40AM
Found the reason.

At the beginning of all define/configuration file. There is a directive: user

They are must be the same. I change it to all nginx user.

It runs.

However, I dive into another problem. I will create a new thread soon.

Thanks for all!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 94
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