redhat 6.5 php 升级到5.6
admin
2023-06-17 09:21:49
0

1. Verify current version of PHP

 

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/

相关内容

热门资讯

第二艘国产大型邮轮完成试航 第二艘国产大型邮轮“爱达·花城号”今天(27日)完成为期12天的试航任务并靠港。在试航期间,技术人员...
文山富宁八角:云上巡林 数据种... 在富宁县新华镇三丫树八角标准化示范基地,传统的山林劳作景象已不复存在,取而代之的是全新的智慧农业场景...
10位上榜者展示四川科技榜样力... 第七届四川省“最美科技工作者”名单揭晓 10位上榜者展示四川科技榜样力量 5月26日,10位第七...
特朗普称将就对台军售和赖清德“... ‍‍5月27日,国务院台湾事务办公室举行例行新闻发布会,发言人陈斌华就近期两岸热点问题回答记者提问。...
掌静脉还是人脸识别?企业考勤设... 以前很多企业选考勤机,关注点其实很简单:能不能打卡、会不会漏数据、价格贵不贵。 但这两年,情况明显变...
兰州石化技术革新获突破 33个... 5月25日,兰州石化研究院(科技创新中心)数智化团队技术革新取得新突破,其牵头研发的地下管网泄漏在线...
美暂停一项对台军售案,民进党当... 5月27日,国务院台办举行例行新闻发布会。有记者问:据报道,美方近日表示,美正暂停一项对台军售案,民...
海协会与台湾海基会联系机制停摆... 【环球网报道】5月27日上午,国台办举行例行新闻发布会,发言人陈斌华就近期两岸热点问题回答记者提问。...
多参数一体化检测 HX-F 型... 水是生命之源,保障水安全是人类社会面临的永恒课题。随着科技进步,便携式多参数水质测定仪正悄然改变传统...
从一张午餐桌到无限宇宙,李飞飞... 500万年,这是人类语言在进化史上的年龄。5.4亿年,这是视觉和空间感知催生寒武纪生命大爆发的起点。...