有些时候我们需要安装不同版本的php,目前php版本的php5.4、php5.5、php5.6、php7.0已经没有下载地址了,只有php7.1、php7.2、php7.3,那么如何安装其中一个版本呢?安装版本后发现插件少了一个需要安装怎搞?1.安装任意一个版本可以用remi源安装,默认的源只有php5.5
2.如果要安装插件可以直接yum install插件名或者用phpize进行安装
2.1安装指定的php版本
#1.安装epel和remi源mkdir /disk1/tools
cd /disk1/tools/
#不行就用wget下载
rpm-Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wge thttp://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
rpm -ih remi-release-7.rpm
#2. 指定源
#指定源我们会用到yum的一个参数--enablerepo=[repo] 启用一个或多个软件源(支持通配符)
如:我这里用的是remi源,所以格式为yum --enablerepo=remi
#还可以多个,如我指定php73的,可以写成yum --enablerepo=remi,php73 install xxx
#3.安装依赖yum -y install libxml2-develbzip2-devel libpng-devel libmcrypt-devel l