centos 7安裝php

查看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;#不能少,不然訪問會出現空頁面
        }
}
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。