CentOS 5.3 How to upgrade PHP with Yum

Source: Internet
Author: User
Tags gpg
CentOS 5.3 How to upgrade PHP with Yum

Method One (PHP5.3):

The PHP version of CentOS5.3 defaults to 5.1.6, and then there is a vulnerability in PHP before 5.2.9, but Yum update is not available in many places on the Web at this time php* Upgrade to 5.2.9, the more common is to upgrade to 5.2.6 version, after searching abroad data, now finally found a way to upgrade the CentOS PHP to 5.2.9.

Note that this method can only be upgraded on the official PHP version, if you use the online upgrade to 5.2. Version 6 upgrade method has been upgraded, you will not be able to use this method to upgrade PHP.
Run the following command:

wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/5/remi/i386/remi-release-5-7.el5.remi.noarch.rpm
RPM-UVH remi-release-5*.rpm epel-release-5*.rpm

Then edit/etc/yum.repos.d/remi.repo
#vi/etc/yum.repos.d/remi.repo
Add a line at the end of this file:
Priority=1

Save exit.

/etc/yum.repos.d/epel.repo and/etc/yum.repos.d/epel-testing.repo These two files are also edited according to the above Method!

Use the following command to upgrade, but after testing, if the individual upgrade of PHP will fail, only with MySQL upgrade can be, so we must execute the following command to upgrade PHP to 5.2. Version 9:

Yum–-enablerepo=remi Update php* mysql*

Note: This method upgrades PHP to 5.3.

Method Two (PHP5.2):

Or go to http://oss.oracle.com/.

Next to php5.2 RPM package

Method Three:

#vi/etc/yum.repos.d/utterramblings.repo

Input

[Utterramblings]
Name=jason ' s utter ramblings Repo
baseurl=http://www.test.com/media/el$releasever/$basearch/
Enabled=1
Gpgcheck=1
Gpgkey=http://www.test.com/media/rpm-gpg-key-jlitka

At last

Yum Update php-y

Now I'm using it this way, after the upgrade version
php-5.2.11
httpd-2.2.14

Centos5.4 (webmin) Yum upgrade mysql5.1 and php5.2 (Forbidden php5.3) centos5.3,centos5.4 install webmin default is MySQL 5.0,php5.1 I need to upgrade to

mysql5.1 and php5.2 (Forbidden php5.3), what to do?

Install Rpmforge for Yum:

Yum list MySQL PHP discovery is the latest version, it appears that the standard Yum source is not updated

wget Http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpmwget/HTTP Rpms.famillecollet.com/el5.i386/remi-release-5-7.el5.remi.noarch.rpmrpm-uvh remi-release-5-7.el5.remi.noarch.rpm epel-release-5-4.noarch.rpmyum--enablerepo=remi list MySQL

Discovery can be upgraded to MySQL 5.1.44-1.el5.remi

Yum--enablerepo=remi update MySQL

The system will automatically upgrade PHP to 5.3 by default when the upgrade is found, and Zend Optimizer does not currently support Php5.3, so it is necessary to disable the upgrade php5.3

Vi/etc/yum.conf

Add last line

exclude=php*5.3*

Then yum--enablerepo=remi update MySQL, you will not see the upgrade of PHP.

Get:

[root@www.scutephp.com backup]# php-v or Old 5.1.6
PHP 5.1.6 (CLI) (Built:jan 13 2010 17:13:05)
Copyright (c) 1997-2006 the PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
With Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
With Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

[root@www]# Mysql-v upgraded to 5.1.44.
MySQL Ver 14.14 distrib 5.1.44, for Redhat-linux-gnu (i686) using ReadLine 5.1

After you upgrade MySQL 5.1.41-1, do the following:
(1) The original/ETC/MY.CNF backup, renamed/etc/my.cnf.rpmnew to MY.CNF
(2) Upgrade table
Mysql_upgrade-p
(3) Automatic repair table
Mysqlcheck--all-databases--check-upgrade--auto-repair-p

Find a Yum source, with php5.2, as follows:

RPM--import Http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andywget-P/etc/yum.repos.d/http:// Repo.webtatic.com/yum/webtatic.repoyum--enablerepo=webtatic list PHP

Found php5.2 and php5.3 can be upgraded,

We prohibit upgrade php5.3
Vi/etc/yum.conf
Add last line
exclude=php*5.3*

Or:

Yum--enablerepo=webtatic--exclude=php*5.3* list phpyum--enablerepo=webtatic--exclude=php*5.3* update-y php

[root@www]# php-v upgrade to 5.2.12, knock it off!

PHP 5.2.12 (CLI) (Built:dec 17 2009 19:40:56)
Copyright (c) 1997-2009 the PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
With Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
With Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

Yum-allowdowngrade can downgrade the plugin:

Allow downgrade for Yum:

Yum Install Yum-allowdowngrade

Add a line to yum.conf:

Showdupesfromrepos=1

After the list all PHP packages:

Yum list php

If PHP 5.2.8 is available, remove new one:

Yum Remove PHP

and install an old one:

Yum--allow-downgrade Install php-5.2.8

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.