A
A
Archakov Dennis2016-08-24 11:10:17
PHP
Archakov Dennis, 2016-08-24 11:10:17

Error when accessing php: No input file specified?

I manually configure the server and there was a problem that the server does not work correctly with PHP scripts.

server {

  listen   80 default_server;
  listen   [::]:80 default ipv6only=on;

  root /var/www/site;
  index index.html index.php;

  server_name site.com;

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

  location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;

    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;

    include fastcgi_params;

    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #fastcgi_param   PATH_TRANSLATED  $document_root$fastcgi_path_info;
  }

  location /sqladmin {
    alias /usr/share/phpmyadmin/;
    location ~ \.php$ {
      #fastcgi_pass unix:/var/run/php-pool-name.sock;
      #fastcgi_pass unix:/var/run/php5-fpm.sock;
      fastcgi_pass 127.0.0.1:9000;
      fastcgi_index index.php;
      include fastcgi_params;
      fastcgi_param SCRIPT_FILENAME $request_filename;
      fastcgi_ignore_client_abort off;
    }
  }
}

There is a path to this folder. Doesn't open PHP files. For example .txt . But, in PHP it swears by an errorNo input file specified

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nurlan, 2016-08-24
@daager

What version of nginx? From some version, the snippets folder appeared, it will be enough to include snippets/fastcgi-php.conf than to prescribe all fastcgi_* yourself.
Have you put PHP on port 9000? By default, it does not listen on a port, but works as a socket.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question