如何在CentOS上使用yum将PHP 5.1升级到PHP 5.3

Modified on: Wed, 14 Aug 2019 06:00:02 +0800

使用Yum / CentOS。

问题是php 5.1已经安装并正在运行

  

yum update php

不工作!

我环顾网络寻找解决方案,但他们说要做上述= /

最佳答案

你想yum install php53。不幸的是,你需要先删除php(这是php 5.1,见下文)。

php53在CentOS 5.6及以上版本中可在CentOS中使用一>。除非您通过第三方存储库,否则它在CentOS 5.5和之前版本中不可用。这就是为什么Serverfault上的许多答案都会告诉您使用第三方存储库 - 这已经不再需要了。

请注意,php53有很多依赖项,因此您应该考虑将CentOS更新到最新的CentOS 5.x分支,作为此升级的一部分(截至本文撰写时为CentOS 5.6)。这是PHP的一次重大升级,RedHat迫使它通过,因为它们远远落后于RHEL5.5。

注意包的名称是php53,而php是php 5.1:

$ yum info php53
Available Packages
Name       : php53
Arch       : x86_64
Version    : 5.3.3
Release    : 1.el5_6.1
Size       : 1.3 M
Repo       : updates
Summary    : PHP scripting language for creating dynamic web sites
URL        : http://www.php.net/
License    : PHP and LGPLv2 and LGPLv2+
Description: PHP is an HTML-embedded scripting language. PHP attempts to make it
           : easy for developers to write dynamically generated webpages. PHP also
           : offers built-in database integration for several commercial and
           : non-commercial database management systems, so writing a
           : database-enabled webpage with PHP is fairly simple. The most common
           : use of PHP coding is probably as a replacement for CGI scripts.
           :
           : The php package contains the module which adds support for the PHP
           : language to Apache HTTP Server.

$ yum info php
Available Packages
Name       : php
Arch       : x86_64
Version    : 5.1.6
Release    : 27.el5_5.3
Size       : 2.3 M
Repo       : base
Summary    : The PHP HTML-embedded scripting language. (PHP: Hypertext Preprocessor)
URL        : http://www.php.net/
License    : The PHP License v3.01
Description: PHP is an HTML-embedded scripting language. PHP attempts to make it
           : easy for developers to write dynamically generated webpages. PHP also
           : offers built-in database integration for several commercial and
           : non-commercial database management systems, so writing a
           : database-enabled webpage with PHP is fairly simple. The most common
           : use of PHP coding is probably as a replacement for CGI scripts.
           :
           : The php package contains the module which adds support for the PHP
           : language to Apache HTTP Server.

相关问答

添加新评论