查看centos版本
cat /etc/redhat-release
uname -a/-r 等
參考
https://wiki.centos.org/HowTos/php7
安裝好后,配置nginx
server{
listen 80;
server_name t1.com;
root /var/www/html;
#非php文件走這里
location /{
index index.html;
}
#php文件走這里
location ~ \.php$ {
root /usr/share/nginx/html;#這里就是下面$document_root的變量值
fastcgi_pass 127.0.0.1:9000;#代理到php-fpm
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;#不能少,不然訪問會出現空頁面
}
}