https://www.jianshu.com/p/1e23aba0a164

建议方法

  1. # 安装EPEL yum存储库
  2. yum install epel-release -y
  3. # 安装Remi存储库
  4. rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
  5. # 安装 PHP 7.3
  6. yum --enablerepo=remi-php73 install php
  7. # 安装 PHP 7.2
  8. yum --enablerepo=remi-php72 install php
  9. # 安装 PHP 7.1
  10. yum --enablerepo=remi-php71 install php

安装php yum源

  1. # 方法一:
  2. rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  3. rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
  4. # 方法二:
  5. yum install epel-release -y
  6. rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
  7. yum -y remove php*
  8. yum list php*
  9. #安装php精简拓展
  10. yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel
  11. # 也可以安装 豪华版拓展
  12. yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel php72w-embedded php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml