Php

如何在 CentOS 上使用 yum 將 PHP 5.1 升級到 PHP 5.3

  • August 11, 2013

使用百勝/CentOS。

問題是 php 5.1 已經安裝並正在執行,所以

百勝更新php

不工作!

我在網上四處尋找解決方案,但他們說要執行上述操作 =/

你會想要的yum install php53。不幸的是,您需要先刪除php(這是 php 5.1,見下文)。

php53 在CentOS 5.6 及更高版本中可用。它在 CentOS 5.5 和之前的版本中不可用,除非您通過第三方儲存庫。這就是為什麼 Serverfault 上的許多答案告訴您使用第三方儲存庫的原因——這不再是必要的了。

請注意,php53 有許多依賴項,因此您應該考慮將 CentOS 更新到最新的 CentOS 5.x 分支作為此次升級的一部分(在撰寫本文時為 CentOS 5.6)。這是 PHP 的一次重大升級,RedHat 強行通過,因為它們在 RHEL5.5 時已經落後於時代。

注意包是如何命名的php53,而phpphp 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.

引用自:https://serverfault.com/questions/295702