CentOS/RHEL 7.x:
rpm -Uvh https:
//mirror
.webtatic.com
/yum/el7/epel-release
.rpm
rpm -Uvh https:
//mirror
.webtatic.com
/yum/el7/webtatic-release
.rpm
CentOS/RHEL 6.x:
rpm -Uvh https:
//mirror
.webtatic.com
/yum/el6/latest
.rpm
CentOS/RHEL 5.x:
rpm -Uvh https:
//mirror
.webtatic.com
/yum/el5/latest
.rpm
添加完yum源之后就可以直接使用yum命令安装php5.5了:
yum
install
php54w
yum
install
php54w-pecl-memcache php54w-pecl-redis
安装PHP5.4的其它常用扩展:
yum -y
install
php54w-curl php54w-gd* php54w-pdo* php54w-xmlrpc php54w-xml php54w-mcrypt php54w-fpm php54w-cli php54w-cgi php54w-pear* php54w-mbstring php54w-mysql php54w-devel php54w-pecl-apc php54w-pecl-zendopcache php54w-pecl-memcache php54w-pecl-redis
yum源添加后,如果报错
Error: xz compression not available
说明安装了不匹配操作系统版本的yum源,如CentOS6装了CentOS7的源,需要将不适当的源删除掉。
安装php-mcrypt模块报错:
Error: Package: php55w-mcrypt-5.5.38-1.w6.x86_64 (webtatic)
Requires: libmcrypt.so.4()(64bit)
安装libmcrypt.so.4方法:
wget http://mirrors.hust.edu.cn/epel//6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
yum install libmcrypt-devel