centos7 升级php版本

centos7 默认PHP5.4,版本太低,很多要求至少PHP5.5

1、查看已经安装的PHP组件

yum list installed| grep php

php.x86_64                            5.4.16-46.el7                    @base    
php-cli.x86_64                        5.4.16-46.el7                    @base    
php-common.x86_64                     5.4.16-46.el7                    @base

2、卸载原有PHP组件

yum remove php.x86_64 php-cli.x86_64 php-common.x86_64

3、安装新源

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

4、安装PHP5.5

yum install php55w.x86_64 php55w-cli.x86_64 php55w-common.x86_64 php55w-gd.x86_64 php55w-ldap.x86_64 php55w-mbstring.x86_64 php55w-mcrypt.x86_64 php55w-mysql.x86_64 php55w-pdo.x86_64

5、查看版本

php -v

PHP 5.5.38 (cli) (built: Jul 21 2016 12:25:20) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

 

6、升级后安装memcache

yum -y install memcached  #安装memcached

chkconfig memcached on  # 开机启动

service memcached start  # 启动服务

netstat -tunlp | grep memcached  # 查看memcached是否启动

yum install libmemcached  # 安装libmemcached

// 如果php中 new Memcached()   # 安装memcached

yum install php55w-pecl-memcached.x86_64  # 安装升级版本对应的memcached   

// 如果php中 new Memcache()   # 安装memcache

yum install php55w-pecl-memcache.x86_64  # 安装升级版本对应的memcache   

posted @   河在谈  阅读(924)  评论(0编辑  收藏  举报
编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
历史上的今天:
2018-06-27 edusoho 支持同一账号多人同时登录
2017-06-27 url传输中+转为%2B取到变空格的问题
点击右上角即可分享
微信分享提示