如何在CentOS上安装PHP 5.3?

Modified on: Sun, 25 Aug 2019 05:00:02 +0800

我必须在我的CentOS服务器上安装PHP 5.3。如果我执行yum install php,基本存储库将安装5.1.6,这对于我需要安装的应用程序来说太旧了。所以我一直在尝试使用IUS存储库,遵循IUS的官方指示:

root@linuxbox ~]# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1-2.ius.el5.noarch.rpm

root@linuxbox ~]# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-1-1.ius.el5.noarch.rpm

root@linuxbox ~]# rpm -Uvh ius-release*.rpm epel-release*.rpm

行。现在我只需要yum install php53等等我所需要的......但是我收到了这个错误:

Running rpm_check_debug
Running Transaction Test
Finished Transaction Test


Transaction Check Error:
  file /usr/bin/php from install of php53u-cli-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-cli-5.1.6-27.el5_5.3.x86_64
  file /usr/bin/php-cgi from install of php53u-cli-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-cli-5.1.6-27.el5_5.3.x86_64
  file /usr/share/man/man1/php.1.gz from install of php53u-cli-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-cli-5.1.6-27.el5_5.3.x86_64
  file /etc/php.ini from install of php53u-common-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-common-5.1.6-27.el5_5.3.x86_64

Error Summary
-------------

我不知道如何解决这个问题。我想我必须删除基础包。但是,作为Linux新手,我不知道该怎么做。

最佳答案

更新:显然是RHEL 5.6 包括PHP 5.3,所以很快就会出现在CentOS上。

安装php53u-cli-5.3.4-3.ius.el5.x86_64的

file /usr/bin/php from install of php53u-cli-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-cli-5.1.6-27.el5_5.3.x86_64
file /usr/bin/php-cgi from install of php53u-cli-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-cli-5.1.6-27.el5_5.3.x86_64
file /usr/share/man/man1/php.1.gz from install of php53u-cli-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-cli-5.1.6-27.el5_5.3.x86_64
file /etc/php.ini from install of php53u-common-5.3.4-3.ius.el5.x86_64 conflicts with file from package php-common-5.1.6-27.el5_5.3.x86_64

这里的问题是你正在安装的软件包有不同的名称(php53而不是php),但是它们会尝试安装相同的文件......因此存在冲突。这不一定是将软件包放在一起的最佳方式,但我不知道是否有更好的软件包,所以我们会忽略它。

删除当前安装的软件包:

# yum remove php-cli php-common php

因此,通常,yum remove <list of packages>将删除包。当然,yum list installed可以查看已安装软件包的列表(或rpm -qa)。

作者:,larsks

相关问答

添加新评论