To update PHP with Yum, you only need to use one command:
CopyCode The Code is as follows: # Yum update PHP
But the problem arises. After using this command, the system tells me that no updatable package is found. The current PHP version is only 5.2.1, and PHP has been officially updated to 5.2.6.
After some inquiry, I realized that PHP is still 5.2.1 In the original centos system source, and an additional source is required to Upgrade PHP.
According to foreign netizens, binggu adds additional sources:
After logging on to SSH, run the following commands in sequence:Copy codeThe Code is as follows: # rpm-import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
# Vi/etc/yum. Repos. d/utterramblings. Repo # in this article, Nano is used, but VPs cannot start Nano. It is also possible to use VI instead.
Add the following content to the open document:Copy codeThe Code is as follows: [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
Save.
Run the following command again to complete the PHP upgrade.Copy codeThe Code is as follows: # Yum update PHP
Similarly, run the following command to upgrade MySQLCopy codeThe Code is as follows: # Yum update MySQL