在 CentOS 6.3 上安装 PHP 5.4.11

在 CentOS 6.3 上安装 PHP 5.4.11

PHP 5.3.3的服务器上CentOs 6.3,由于此版本的PHP易受攻击,现在尝试升级到,PHP 5.4.11但默认存储库CentOs没有,PHP > 5.3.3所以yum无法检测到较新的版本。

然后我remi在我的服务器上安装了存储库

rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

这些命令已成功安装存储库

现在升级 PHP 的命令

yum --enablerepo=remi,remi-test update httpd mysql mysql-server php php-common 

但它失败并显示以下错误消息

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

如果我尝试yum info php相同的错误信息

基本上,安装这些存储库后yum它们就不起作用了,但是 yum 之前是可以工作的。

如果我删除这些存储库并尝试,yum它可以正常工作而不会出现任何错误。

我怎样才能PHP升级到PHP 5.4.11版本?

编辑 正如@Michael建议的那样,我跑了

yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base epel extras updates
Cleaning up Everything
Cleaning up list of fastest mirrors
`[root@www ~]# yum --obsoletes update
Loaded plugins: fastestmirror
Determining fastest mirrors
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

还是同样的错误

编辑2

内容epel.repo

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

互联网连接运行良好,我已检查

 wget http://google.com

编辑3

正如@Michael建议的那样,我跑了

URLGRABBER_DEBUG=1 yum check-update 最后出现了以下错误

 Problem with the SSL CA cert (path? access rights?)
2013-02-24 20:31:45,730 exception: [Errno 14] PYCURL ERROR 77 - "Problem with the SSL CA cert (path? access rights?)"
INFO:urlgrabber:exception: [Errno 14] PYCURL ERROR 77 - "Problem with the SSL CA cert (path? access rights?)"
2013-02-24 20:31:46,051 retrycode (14) not in list [-1, 2, 4, 5, 6, 7], re-raising
INFO:urlgrabber:retrycode (14) not in list [-1, 2, 4, 5, 6, 7], re-raising
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

因此,实际问题出在 SSL 证书上,但为什么它会抱怨 SSL 证书,尽管它是有效的

答案1

添加新的存储库后,请清除 yum 缓存并更新系统,然后再尝试安装任何其他软件包。

yum clean all
yum --obsoletes update

根据您更新的信息,您的本地 CA 证书似乎已损坏或被删除。请尝试重新安装它们:

yum reinstall ca-certificates

答案2

查看 epel.repo

更改了 https

镜像列表=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch 到 mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch

有效!

答案3

更新旧版本的解决方案:

rpm -e epel-release
yum clean all
yum -y --obsoletes update --skip-broken
yum reinstall ca-certificates
yum -y update --skip-broken
yum -y install epel-release

相关内容