yum配置
执行命令下载、安装yum源,当前是针对Centos6并且64位版本的源:
[root@T_249 yum.repos.d]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm [root@T_249 yum.repos.d]# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
编辑[remi.repo]下的enabled选项从0设为1
[root@T_249 yum.repos.d]# sed -i '/enabled/s/=0/=1/g' /etc/yum.repos.d/remi.repo
运行如下命令
[root@T_249 yum.repos.d]# yum clean all [root@T_249 yum.repos.d]# yum makecache
安装PHP5.4
[root@T_249 yum.repos.d]# yum install PHP54 PHP54-PHP-devel PHP54-PHP-MysqL* PHP54-PHP-gd PHP54-PHP-fpm PHP54-PHP-mbstring
如果安装PHP5.5
[root@T_249 yum.repos.d]# yum install PHP55 PHP55-PHP-devel PHP55-PHP-MysqL* PHP55-PHP-gd PHP55-PHP-fpm PHP55-PHP-mbstring
[root@T_249 yum.repos.d]# yum list PHP* |grep PHP-devel PHP-devel.x86_64 5.3.3-46.el6_6 @updates PHP54-PHP-devel.x86_64 5.4.45-2.el6.remi @remi PHP-devel.x86_64 5.6.15-1.el6.remi remi-PHP56 PHP55-PHP-devel.x86_64 5.5.30-1.el6.remi remi PHP56-PHP-devel.x86_64 5.6.16-0.1.RC1.el6.remi remi-test PHP70-PHP-devel.x86_64 7.0.0-0.25.RC8.el6.remi remi
运行如下命令[yum update PHP*],则直接升级到PHP5.6
安装运行yum报错解决方法:
Error: Cannot retrieve Metalink for repository: epel. Please verify its path and try again
编辑[epel.repo]下的baseurl前的#号去掉,mirrorlist前添加#号
[root@T_249 yum.repos.d]# sed 's/#baseurl=/baseurl=/g;s/mirrorlist=/#mirrorlist=/g' /etc/yum.repos.d/epel.repo原文链接:https://www.f2er.com/centos/379608.html