P
P
Pavel Ivanov2014-07-07 14:12:38
PHP
Pavel Ivanov, 2014-07-07 14:12:38

What could be wrong with Nginx configuration?

I have been trying to set up Nginx for several hours with no success. When accessing, I get - No input file specified.
Config:

server {
    listen 80;
    root /var/www/server.com/public;
    index index.php index.html index.htm;
    server_name server.com;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         fastcgi_pass unix:/var/run/php5-fpm.sock;
         fastcgi_index index.php;
         include etc/nginx/fastcgi_params;
    }
}

What could be the reason?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Igor, 2014-07-07
@merryjane

Tried to pick up a simple file (not php)?
What happens if you explicitly try to pick up any php file? For example server.com/phpinfo.php
Is anything written to error.log?

S
Sergey Petrikov, 2014-07-07
@RicoX

Check the existence of /var/run/php5-fpm.sock; and whether php-fpm is running on the given socket. If everything is ok, add fastcgi_intercept_errors on; for more sane errors.

P
Pavel Ivanov, 2014-07-07
@eastywest

I tried to take a simple file - No input file specified
Index.php is in /var/www/server.com/public and the same error occurs at the request of server.com.
In FastCGI logs
sent in stderr: Unable to open primary script : /var/www/server.com/public/index.php (no such file or directory) /var/run/php5-fpm.sock
exists
php-fpm on this socket?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question