W
W
WebDev2016-03-13 22:56:24
PHP
WebDev, 2016-03-13 22:56:24

Nginx + php-fpm file not found?

Tell me what's wrong, installed nginx + php-fpm, set up a file for the domain:

server {
    listen       80;
    server_name  test;

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

    location ~ \.php$ {
        root           /var/www/html/test/contacts.php;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        include        fastcgi_params;
    }
}

I try to open test/ in the browser, it opens html files, swears at php files, writes File not found.
As I understand it, I incorrectly indicated something in the location ~\.php section.
Help me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2016-03-13
@kirill-93

This line here implies that all your php files are in the folder/scripts
You need to replace /scriptsit with the real path to the files. It looks like you have it /var/www/html/test.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question