I'm trying to open a php file (Hello World!) In a browser. Chrome issues (No input file specified.) There are no errors in the php7.0-fpm.log logs. In the logs, nginx writes:

::1 - - [24/Oct/2016:18:02:15 +0300] "GET /certunia/helloworld.php HTTP/1.1" 404 56 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/53.0.2785.143 Chrome/53.0.2785.143 Safari/537.36" 

default file:

 server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; server_name localhost; root /usr/share/nginx/html; location / { } location /certunia/ { index index.php index.html; alias /home/certunia/php; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; fastcgi_index index.php; include fastcgi.conf; fastcgi_param SCRIPT_FILENAME /home/certunia/php$fastcgi_script_name; } } } 
  • theoretically, there is not enough slash after php /home/certunia/php/$fastcgi_script_name - DiGiTAL

1 answer 1

 server { listen 80; server_name localhost; root /usr/share/nginx/html; index index.html index.htm index.php; charset utf-8; location / { try_files $uri $uri/ /index.php$is_args$args; } access_log off; error_log /var/log/nginx/site.log error; sendfile off; client_max_body_size 100m; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/run/php/php7.0-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors off; fastcgi_buffer_size 16k; fastcgi_buffers 4 16k; } location ~ /\.ht { deny all; } } 
  • It helped, thanks. - Daniel Tuneev