Use yum to update php, just use one command to do it:
#yum update php
But the problem is coming. After using this command, the system told me that no available code was found. Updated package. The current PHP version is only 5.2.1, and PHP has been officially updated to 5.2.6.
After some inquiries, I found out that the source of php in the original centos system is still 5.2.1, and additional sources are needed to upgrade php.
According to the introduction of foreign netizens, Binggu added additional sources:
After logging in to ssh, run the following commands in sequence:
#rpm –import http://www.jasonlitka.com /media/rpm-gpg-key-jlitka
#vi /etc/yum.repos.d/utterramblings.repo # Nano is used here in the article, but vps cannot start nano. It is also possible to use vi instead. Yes
Add the following content to the open document:
[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
#yum update php
Similarly, run the following command to upgrade mysql
#yum update mysql
The above is the detailed content of How to upgrade PHP and MySQL in CentOS system. For more information, please follow other related articles on the PHP Chinese website!