Method 1
The default php version of CentOS5.3 is 5.1.6, and php versions earlier than 5.2.9 have a vulnerability. However, yum update php * cannot be upgraded to 5.2.9 in many places on the Internet, it is common to upgrade to version 5.2.6. After searching for foreign materials, we finally find a method to Upgrade php to version 5.2.9 from CentOS.
Note: This method can only be upgraded in the official php version. If you have used the online Upgrade Method to 5.2.6, 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-3.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
Edit/etc/yum. repos. d/remi. repo.
# Vi/etc/yum. repos. d/remi. repo
Add a line at the end of the file:
Priority = 1
Save and 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!
The following command is used to upgrade the version. However, after testing, If You Upgrade php separately, the system prompts that the upgrade fails. Only China Unicom mysql can be upgraded together. Therefore, you must execute the following command to Upgrade php to version 5.2.9:
Yum -- enablerepo = remi update php * mysql *
PS: This method upgrades php to 5.3.
Method 2
Or go http://oss.oracle.com/
Source: (http://blog.sina.com.cn/s/blog_45ef57d40100hq7c.html)-CentOS 5.3 Through yum Upgrade php to the latest version of the method _ borui _ Sina Blog
Next, run the php5.2 rpm package.
Method 3
Vim/etc/yum. repos. d/utterramblings. repo
Input
[Utterramblings]
Name = Jason's Utter Ramblings Repo
Baseurl = http://www.jasonlitka.com/media/el?releasever/?basearch/
Enabled = 1
Gpgcheck = 1
Gpgkey = http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
Final Installation
Yum install httpd php
Currently, I am using this method.
Php-5.2.11
Httpd-2.2.14
Method 4
CentOS adds an official source for yum
Since centos5.4 is installed with yum to install php version 5.1.6, many sites are developed on 5.2.x, so we need to add other yum repo
To install Php5.2.x and test several unofficial repo repositories. I feel that the Code is not very stable and the php version is being upgraded at any time. After searching for a long time, I found centos
The official test repo contains php5.2.x, which makes it easier to install the official centos rpm.
1. Add yum repo php5.2.x
Vi/etc/yum. repos. d/CentOS-Testing.repo
C5-testing
Name = CentOS-5 Testing
Baseurl = http://dev.centos.org/centos/?releasever/testing/?basearch/
Enabled = 1
Gpgcheck = 1
Gpgkey = http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
Priority = 1
2. Installation
Yum upgrade php