Welcome! Log In Create A New Profile

Advanced

Nginx + PHP 7

Posted by paradoxtech 
Nginx + PHP 7
October 26, 2017 10:47PM
Hi folks,

I'm very sorry if this one is going to cause some folk to shake their heads in dismay.. but I genuinely CANNOT get Nginx to process PHP. I have tried numerous different configurations and workarounds found in all corners of the Google webs.

Ubuntu 14.04
Nginx 1.4.6
PHP 7.0

I've tried numerous different setups for the Nginx 'default' file, this is the current:

________________

server {
listen 80 default_server;
listen [::]:80 default_server;

root /var/www/html;
index index.php index.html index.htm index.nginx-debian.html;

server_name server_domain_or_IP;

location / {
try_files $uri $uri/ =404;
}

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass /run/php/php7.0-fpm.sock;
}

location ~ /\.ht {
deny all;
}
}
______________________

I've also ensured cgi.fix_pathinfo=0 in /etc/php/7.0/fpm/php.ini.

I've restarted Nginx, restarted php-fpm and restarted the server numerous times.

I CANNOT get Nginx to do anything other than offer a PHP file as a download via Chrome or simply display the PHP contents via IE / Edge.

I'm at my wits end, I very rarely seek help in situations like this. Normally I'd stick with it until I worked it out. I've been at it 3 hours now though.. help!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 304
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready