CentOS 5.6 - php53-common与php-common冲突

错误:CentOS 5.6 - php53-common与php-common冲突 您已在CentOS 5.6上安装了PHP 5.1.6,并希望更新到PHP 5.3,如下所示: ...

错误:CentOS 5.6 - php53-common与php-common冲突

您在CentOS 5.6上安装了PHP 5.1.6,并希望更新为PHP 5.3,如下所示:

yum install php53 php53-cli php53-common php53-gd php53-imap php53-intl php53-mbstring php53-mysql php53-odbc php53-pdo php53-pspell php53-snmp php53-xml php53-xmlrpc

更新会中止以下错误:

[root@server1 ~]# yum install php53 php53-cli php53-common php53-gd php53-imap php53-intl php53-mbstring php53-mysql php53-odbc php53-pdo php53-pspell php53-snmp php53-xml php53-xmlrpc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.weepeetelecom.be
 * extras: centos.weepeetelecom.be
 * updates: ftp.belnet.be
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php53.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-cli.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-common.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-gd.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-imap.x86_64 0:5.3.3-1.el5_6.1 set to be updated
--> Processing Dependency: libc-client.so.1()(64bit) for package: php53-imap
---> Package php53-intl.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-mbstring.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-mysql.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-odbc.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-pdo.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-pspell.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-snmp.x86_64 0:5.3.3-1.el5_6.1 set to be updated
--> Processing Dependency: net-snmp for package: php53-snmp
---> Package php53-xml.x86_64 0:5.3.3-1.el5_6.1 set to be updated
---> Package php53-xmlrpc.x86_64 0:5.3.3-1.el5_6.1 set to be updated
--> Running transaction check
---> Package libc-client.x86_64 0:2004g-2.2.1 set to be updated
---> Package net-snmp.x86_64 1:5.3.2.2-9.el5_5.1 set to be updated
--> Processing Dependency: libsensors.so.3()(64bit) for package: net-snmp
--> Running transaction check
---> Package lm_sensors.x86_64 0:2.10.7-9.el5 set to be updated
--> Processing Conflict: php53-common conflicts php-common
--> Finished Dependency Resolution
php53-common-5.3.3-1.el5_6.1.x86_64 from updates has depsolving problems
  --> php53-common conflicts with php-common
Error: php53-common conflicts with php-common
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.
[root@server1 ~]#

启用您的系统上的Epel和IUS存储库。

对于64位系统,您可以在这里找到正确的软件包: http : //dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/

对于32位系统,正确的软件包在这里: http : //dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/

在找到Epel和IUS rpm软件包的正确链接之后,您可以像这样安装它们:

rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-5-4.noarch.rpm
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-8.ius.el5.noarch.rpm

然后导入两个存储库的GPG密钥:

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
rpm --import /etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY

安装yum-plugin-replace软件包:。

yum install yum-plugin-replace

您现在可以使用IUS的PHP 5.3软件包替换您的PHP 5.1.6软件包,如下所示:

yum replace php --replace-with php53u

您可以搜索更多php53u软件包,如下所示:

yum search php53u

如果您发现还要安装的php53u软件包,请从搜索结果列表中选择它们,并按如下所示进行安装:

yum install php53u-pear php53u php53u-cli php53u-common php53u-devel php53u-gd php53u-mbstring php53u-mcrypt php53u-mysql php53u-pdo php53u-soap php53u-xml php53u-xmlrpc php53u-bcmath php53u-pecl-apc php53u-pecl-memcache php53u-snmp

检查您的PHP版本 - 应该显示5.3:

php -v

[root@server1 ~]# php -v
PHP 5.3.6 (cli) (built: Aug 11 2011 23:42:10)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
[root@server1 ~]#

最后重新启动您的Web服务器。 对于Apache,可以按如下方式进行:

/etc/init.d/httpd restart