惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
U
Unit 42
MyScale Blog
MyScale Blog
B
Blog
阮一峰的网络日志
阮一峰的网络日志
量子位
IT之家
IT之家
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Recent Announcements
Recent Announcements
V
Visual Studio Blog
G
Google Developers Blog
Last Week in AI
Last Week in AI
雷峰网
雷峰网
博客园 - 聂微东
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
博客园 - 司徒正美
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
月光博客
月光博客
aimingoo的专栏
aimingoo的专栏

似水流年

Linux下查看CPU架构是否支持V3 VestaCP安装Memcached拓展 Centos下Vestacp面板安装Zend Opcache Ubuntu下安装Zend Opcache CentOS下VestaCP安装PHP-redis、redis VestaCP安装Xcache Centos下Vestacp安装IoncubeLoader 解决npm编译过程中内存溢出错误(ELIFECYCLE Command failed with exit code 134.) npm更换国内淘宝镜像源,权当记录 Windows 11关闭小工具信息流(资讯)的办法 同一服务器下,不同WordPress站点使用同一个Redis库方法 博客用上了阿里云自研云原生数据库PolarDB PHP8.0.X安装fileinfo扩展方法 博客服务器迁移记录 设备安全性中内核隔离提示安全风险记录 急诊室故事 第二季结尾精彩文案分享 Windows11还原Windows10任务栏(任务栏不合并)及开始菜单(磁贴)小工具 宝塔(BT)面板爆出重大安全漏洞,安全等级高,利用难度0(漏洞已由官方修复) Google Chrome用户福音,直接即可更新最新版 腾讯云CDB基础版使用之新建用户及数据库的方法 Windows Defender快速扫描一直提示有1个威胁(根源来自支付宝安全控件),但是无任何记录修复过程 PHPStorm更新到2019.3后设置自动换行的方法 Adobe Photoshop CC 2019中自由变换等比例缩放修改办法 Windows10 1909清除Windows安全中心(Windows Defender)历史记录的办法 Ubuntu下PHP7.2安装Mcrypt扩展方法 Centos下PHP7.2安装Mycrpt扩展的方法 Centos7下Vestacp面板简单升级PHP7.X方法 “轻’”而不“薄”的轻量应用服务器初使用体验 这就是命 WindowsServer2008配置IIS+PHP环境第五讲-安装WordPress和Discuz
Centos7下Vestacp面板升级php版本到7.1
2017-12-04 · via 似水流年

PHP 7 使用新版的ZendEngine引擎,带来了许多新的特性。

PHP 7 相对于 php 5.x 版本在性能方面得到了极大的提高。

然而Vestacp面板一直是用php5.6,面对php7的性能提升,博主本人还是很想试试使用php7.1。

一、准备工作

1.一台安装了Vestacp的机器。

2.备份数据(防止出错后数据丢失)

二、升级php版本

Centos

Centos版本7.4

1.安装epel和remi源(这个不是必须的,先确定一下yum源里有这两个源)

ll /etc/yum.repos.d

如果没有,需要以下命令来安装

 # 如果是CentOS 6的话,就把地址里的7改成6
 wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
 wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
 rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
 # 升级remi源
 yum -y --enablerepo=remi update remi-release

2.停止httpd并卸载旧版本php

#如果仅安装了nginx,那么要停掉php-fpm
service php-fpm stop
#如果安装了apache,那要停止httpd
service httpd stop
#卸载旧版本php
yum -y remove php

3.安装php7.1

yum -y --enablerepo=remi-php71 install php php-pear php-bcmath php-mysqlnd php-gd php-common php-fpm php-intl php-cli php-xml php-pecl-apcu php-pdo php-gmp php-process php-pecl-imagick php-devel php-mbstring

这个时候可能会遇到一个错误,如下图所示:

Error: Package: php-pecl-igbinary-2.0.5~RC1-1.el7.remi.5.6.x86_64 (@remi-test)
           Requires: php(api) = 20131106-64
           Removing: php-common-5.6.32-1.el7.remi.x86_64 (@remi-php56)
               php(api) = 20131106-64
           Updated By: php-common-7.1.11-1.el7.remi.x86_64 (remi-php71)
               php(api) = 20160303-64
           Available: php-common-5.4.16-42.el7.x86_64 (base)
               php(api) = 20100412-64
           Available: php-common-5.4.45-13.el7.remi.x86_64 (remi)
               php(api) = 20100412-64
           Available: php-common-5.5.38-6.el7.remi.x86_64 (remi-php55)
               php(api) = 20121113-64
           Available: php-common-5.5.38-7.el7.remi.x86_64 (remi-php55)
               php(api) = 20121113-64
           Available: php-common-5.6.30-0.1.RC1.el7.remi.x86_64 (remi-test)
               php(api) = 20131106-64
           Available: php-common-5.6.30-2.el7.remi.x86_64 (remi-test)
               php(api) = 20131106-64
           Available: php-common-5.6.31-1.el7.remi.x86_64 (remi-php56)
               php(api) = 20131106-64
           Available: php-common-7.1.10-1.el7.remi.x86_64 (remi-php71)
               php(api) = 20160303-64
Error: Package: php-pecl-igbinary-2.0.5~RC1-1.el7.remi.5.6.x86_64 (@remi-test)
           Requires: php(zend-abi) = 20131226-64
           Removing: php-common-5.6.32-1.el7.remi.x86_64 (@remi-php56)
               php(zend-abi) = 20131226-64
           Updated By: php-common-7.1.11-1.el7.remi.x86_64 (remi-php71)
               php(zend-abi) = 20160303-64
           Available: php-common-5.4.16-42.el7.x86_64 (base)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.45-13.el7.remi.x86_64 (remi)
               php(zend-abi) = 20100525-64
           Available: php-common-5.5.38-6.el7.remi.x86_64 (remi-php55)
               php(zend-abi) = 20121212-64
           Available: php-common-5.5.38-7.el7.remi.x86_64 (remi-php55)
               php(zend-abi) = 20121212-64
           Available: php-common-5.6.30-0.1.RC1.el7.remi.x86_64 (remi-test)
               php(zend-abi) = 20131226-64
           Available: php-common-5.6.30-2.el7.remi.x86_64 (remi-test)
               php(zend-abi) = 20131226-64
           Available: php-common-5.6.31-1.el7.remi.x86_64 (remi-php56)
               php(zend-abi) = 20131226-64
           Available: php-common-7.1.10-1.el7.remi.x86_64 (remi-php71)
               php(zend-abi) = 20160303-64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

解决办法是:remove掉错误的包,我remove掉第一个包后就正常了!

yum remove php-pecl-igbinary-2.0.5~RC1-1.el7.remi.5.6.x86_64

4.安装memcache客户端以及opcache

yum -y --enablerepo=remi-php71 install php-opcache php-memcache

5.重启php-fpm或是httpd

#启动php-fpm
service php-fpm start
#启动httpd
service httpd start

最后php-v查看一下php版本

微信扫描下方的二维码阅读本文

版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权,转载请联系作者。
文章名称:《Centos7下Vestacp面板升级php版本到7.1》
文章链接:https://wangjunwei.com/website/vestacp/635.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。