Background & Environment
I am attempting to deploy a Nginx server with PHP7.1-FPM, following the instructions here and here:
- The server is Ubuntu
16.04
- Nginx version is
1.13.3
- PHP version is
PHP 7.1.9-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Sep 2 2017 05:56:43) ( NTS )
I am fairly new to all this, so compared to a seasoned linux admin, I am still somewhat ignorant of what's what, but I know enough to handle the basics.
The Issue
When I browse to a URL with as inspired01.DOMAIN.com/application/
I get a blank page. There is no entry in the nginx error log.
When I browse to a URL such as inspired01.DOMAIN.com/application/index.php
I get a 404 error.
Tried so far
I have attempted the suggestions in the stackoverflow post here. As far as I could tell, my configuration already has the suggested entries that people are saying fixed this problem for them.
I was not able to resolve the issue with those answers. As that post is a few years old, I am thinking perhaps requirements have changed since then.
My Nginx configuration
My nginx.conf
is:
user inspired786;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 1024;
multi_accept on;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 25;
types_hash_max_size 2048;
server_tokens off;
client_max_body_size 64m;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
gzip_proxied any;
gzip_comp_level 2;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# Virtual Host Configs
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 444;
}
}
The site's conf file is:
server {
listen 80;
listen [::]:80;
server_name inspired01.DOMAIN.com;
access_log /home/inspired786/DOMAIN.com/logs/access.log;
error_log /home/inspired786/DOMAIN.com/logs/error.log;
root /home/inspired786/DOMAIN.com/public/;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
Logs
No entry is generated in the Nginx server or site log.
No relevant entry is recorded to the FPM log at /var/log/php7.1-fpm.log
Question
I would like to know if there is anything obvious missing or wrong in this configuration, which would potentially result in php files not being parsed.
UPDATE
As per comment below, pasting here so anyone new sees it:
I enabled
debug_connection
and went through the masses of log output that produced. As far as I could tell, there were no issues being reported. Well, no obviouserrors
orwarnings
. So I created a basichello.php
file including a basic echo command, and also phpinfo. The file worked fine. So I suspect the issue is something else. Continuing to investigate.
Consider this question on hold for now, whilst I look into some other possibilities for the blank pages issue.