# 删除系统中可能存在之前安装的php相关文件
yum -y remove php*
# 不必担心会影响已经配置好的阿里源
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml
如果你在使用Laravel框架,那么经过上述操作之后你会发现还缺少一个 b cmath 扩展
yum install php72w-bcmath
开机启动:
systemctl enable php-fpm.service
systemctl start php-fpm.service