Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Nginx + PHP 7

$
0
0
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!

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>