1.查看已經(jīng)安裝的php版本號(hào)
鍵入下面代碼:
$ php -v
出現(xiàn)下面代碼:
PHP 5.3.3 (cli) (built: Jul 9 2015 17:39:00)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
2.安裝Remi跟EPEL RPM源
如果你還沒(méi)安裝嚎货,則輸入以下代碼:
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm && rpm -Uvh epel-release-latest-6.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm && rpm -Uvh remi-release-6*.rpm
下載之后:
nano /etc/yum.repos.d/remi.repo
然后對(duì)里面內(nèi)容進(jìn)行以下修改:
[remi]
name=Remi's RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
還有以下:
[remi-php56]
name=Remi's PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror
# WARNING: If you enable this repository, you must also enable "remi"
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
按CTRL+O保存,CTRL+X關(guān)閉編輯器
3.現(xiàn)在可以yum命令直接升級(jí)了
輸入以下代碼
$yum -y upgrade php*
一旦更新完畢蔫浆,再次查看php版本號(hào)
$php -v
出現(xiàn)以下信息
PHP 5.6.14 (cli) (built: Sep 30 2015 14:07:43)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
到此殖属,php升級(jí)完畢