查看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;#不能少,不然访问会出现空页面
}
}
网友评论