點擊查看原文php
安裝 EPEL 軟件包:html
$ sudo yum install epel-release
mysql
安裝 remi 源:nginx
$ sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sql
安裝 yum 擴展包:json
$ sudo yum install yum-utils
segmentfault
啓用 remi 倉庫:centos
$ sudo yum-config-manager --enable remi-php72 $ sudo yum update
php7
$ sudo yum install php72
php-fpm
輸入 php72 -v
查看安裝結果
$ sudo yum install php72-php-fpm php72-php-gd php72-php-json php72-php-mbstring php72-php-mysqlnd php72-php-xml php72-php-xmlrpc php72-php-opcache
$ sudo systemctl enable php72-php-fpm.service
# 開啓服務 $ sudo systemctl start php72-php-fpm.service # 中止服務 $ sudo systemctl stop php72-php-fpm.service # 查看狀態 $ sudo systemctl status php72-php-fpm.service
# nginx 配置文件 /etc/nginx/nginx.conf # nginx 默認項目路徑 /usr/share/nginx/html