1、配置安装yum源 EPEL and Remi repository # yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm # yum install http://rpms.remirepo.net/enterprise/remi-release-6.rpm 2、安装 yum-utils # yum install yum-utils 3、 yum-config-manager 管理要安装的版本,以下3个,选择自己要安装的版本执行 # yum-config-manager --enable remi-PHP72 [Install PHP 7.2] 如果要安装PHP7.0或PHP7.1 # yum-config-manager --enable remi-PHP70 [Install PHP 7.0] # yum-config-manager --enable remi-PHP71 [Install PHP 7.1] 4、开始安装 # yum install PHP PHP-mcrypt PHP-cli PHP-gd PHP-curl PHP-MysqL PHP-ldap PHP-zip PHP-fileinfoPHP-fpm 5、查看版本 # PHP -v PHP 7.2.0 (cli) (built: Nov xxxxxxx) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0,Copyright (c) 1998-2018 Zend Technologies