如何在CentOS 6.7上將PHP 5.3升級到PHP 5.6

如何在CentOS 6.7上將PHP 5.3升級到PHP 5.6

 

在本文中,我將介紹如何在CentOS 6.7上升級PHP 5.3到PHP 5.6。php

本文假設您已經安裝了CentOS,而且已經安裝了PHP 5.3centos

 

1.驗證PHP的當前版本編輯器

 

鍵入如下內容以查看當前的PHP版本:svg

 

php -vpost

 

應該輸出以下:ui

 

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 Technologiesthis

 

好,如今咱們能夠繼續前進!google

 

2.安裝Remi和EPEL RPM存儲庫url

 

若是尚未這樣作,請安裝Remi和EPEL存儲庫spa

 

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

 

全局啓用REMI存儲庫:

 

nano /etc/yum.repos.d/remi.repo

 

在[remi]下面的部分進行如下更改:

 

[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-php55]下面的部分進行如下更改:

 

[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關閉編輯器

 

3.將PHP 5.3升級到PHP 5.6

 

如今咱們能夠升級PHP。只需鍵入如下命令:

 

yum -y upgrade php*

 

更新完成後,請驗證您是否已安裝PHP 5.6:

 

php -v

 

應該看到輸出相似於如下內容:

 

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

相關文章
相關標籤/搜索