使用ubuntu 16.04版本,安装的php7,然后安装了php7.0-fpm。
这里配置有部份不同,不是使用“127.0.0.1:9000”,而是使用“unix:/run/php/php7.0-fpm.sock”。
一个简单的配置如下:
server
{
listen 9997;
root /var/www/html;
index index.html index.htm index.php;
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}