成都网站建设设计

将想法与焦点和您一起共享

redhat6.5php升级到5.6

1. Verify current version of PHP

成都创新互联公司长期为成百上千家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为临漳企业提供专业的网站设计制作、网站设计,临漳网站改版等技术服务。拥有十年丰富建站经验和众多成功案例,为您定制开发。

 

Type in the following to see the current PHP version:

 

php -v

 

Should output something like:

 

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

 

Great, now we can move on!

 

2. Install the Remi and EPEL RPM repositories

 

If you haven’t already done so, install the Remi and EPEL repositories

 

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

 

Enable the REMI repository globally:

 

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

 

Under the section that looks like [remi] make the following changes:

 

[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

 

Also, under the section that looks like [remi-php55] make the following changes:

 

[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

 

Type CTRL-O to save and CTRL-X to close the editor

 

3. Upgrade PHP 5.3 to PHP 5.6

 

Now we can upgrade PHP. Simply type in the following command:

 

yum -y upgrade php*

 

Once the update has completed, let’s verify that you have PHP 5.6 installed:

 

php -v

 

Should see output similar to the following:

 

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

如果要安装zabbix 3.0 还需安装php-mbstring、php-bcmath

安装php-mbstring:yum install -y php-mbstring php-bcmath

参考博文:https://www.zerostopbits.com/how-to-upgrade-php-5-3-to-php-5-6-on-centos-6-7/


分享名称:redhat6.5php升级到5.6
网页链接:http://chengdu.cdxwcx.cn/article/igshej.html