Reputation: 53
I've just installed nginx and php7.0-fpm on clear debian 9 and tried to configure it by standard way, but when i try to access http://mysite/test.php i get blank page. There aren't any errors in /var/log/nginx/error.log or /var/log/php7.0-fpm.log files (i get 200 answers, but page is blank). My configs files below..
/var/www/html/test.php
<?php phpinfo(); ?>
nginx.conf
http {
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
server {
listen 80;
server_name _;
root /var/www/html;
index test.php;
location ~* \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
}
}
#include /etc/nginx/conf.d/*.conf;
#include /etc/nginx/sites-enabled/*;
}
/etc/php/7.0/fpm/pool.d/www.conf
[www]
user = www-data
group = www-data
listen = 127.0.0.1:9000
listen.owner = www-data
listen.group = www-data
Upvotes: 3
Views: 2489
Reputation: 3559
Try to pass the socket path instead of server:port:
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
Also, the server_name _;
will work only if a default server is specified, are you sure the 200 code comes from from the url you requested (you should rule out possible failbacks to other vhost)?
Upvotes: 2
Reputation: 1
Try adding:
fastcgi_param SCRIPT_FILENAME $realpath_root/test.php;
You shouldn't have to 777 anything.
Upvotes: 0