红联Linux门户
Linux帮助

升级VestaCP面板PHP版本至PHP7.0过程记录(CentOS6)

发布时间:2017-02-23 10:08:49来源:laozuo.org作者:老左
如果要细数国外的Linux Web面板大大小小十几二十几个肯定可以找到的,其中有很多以前很知名的面板都陆续没有升级和更新。在众多面板中,VestaCP面板用户还是比较多的,因为在很多海外运维博客中经常看到有介绍VestaCP相关的文章以及应用技巧。
当然在国内网友中,使用VestaCP也是比较多的,比如有些网友会使用它们的邮件功能。前一段时间有网友问如何将VestaCP面板PHP版本升级至PHP7.0。这里在测试机中安装目前官方的VestaCP版本,其中看到PHP版本是5.6.30,这里我准备尝试将当前的VestaCP面板PHP升级至7.0,看看是否可行。
 
第一、升级VestaCP面板PHP版本准备工作
1、如果我们是现有生产环境,一定要记得备份数据,因为我这里采用的是测试机,没有网站数据,所以不用担心。
2、在当前Linux主机中安装好VestaCP面板,这里在测试机中采用的是CentOS 6环境。
3、查看当前PHP版本(php -v)
升级VestaCP面板PHP版本至PHP7.0过程记录(CentOS6)
 
第二、执行VestaCP面板面板升级PHP7.0过程
1、安装repo PHP7依赖扩展
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm
贴上SSH中执行。
2、更新和升级
yum --enablerepo=remi update remi-release
如果遇到需要输入Y/N的时候,输入y回车。
升级VestaCP面板PHP版本至PHP7.0过程记录(CentOS6)
3、暂停apache以及卸载php
service httpd stop
yum -y remove php
升级VestaCP面板PHP版本至PHP7.0过程记录(CentOS6)
4、安装PHP7.0必备软件支持
yum --enablerepo=remi-php70 install php70-php php70-php-pear php70-php-bcmath php70-php-pecl-jsond-devel php70-php-mysqlnd php70-php-gd php70-php-common php70-php-fpm php70-php-intl php70-php-cli php70-php php70-php-xml php70-php-opcache php70-php-pecl-apcu php70-php-pecl-jsond php70-php-pdo php70-php-gmp php70-php-process php70-php-pecl-imagick php70-php-devel php70-php-mbstring
在安装过程中有需要y回车一次。
升级VestaCP面板PHP版本至PHP7.0过程记录(CentOS6)
5、启动新PHP
service php-fpm stop
service php70-php-fpm start
6、设置软链接
rm /usr/bin/php
ln -s /usr/bin/php70 /usr/bin/php
升级VestaCP面板PHP版本至PHP7.0过程记录(CentOS6)
7、启动生效
service httpd restart
升级VestaCP面板PHP版本至PHP7.0过程记录(CentOS6)
8、查看PHP版本
php -v
升级VestaCP面板PHP版本至PHP7.0过程记录(CentOS6)
这里我们可以看到当前的VestaCP面板PHP版本已经升级到7.0。
 
总结,升级完毕之后,在登入VestaCP面板后台一切都正常的,看来这个方法是可以升级到PHP7.0版本,如果我们用户要升级,一定要看清楚在何种环境中,比如centos7与centos6是不同的,我开始一直以为在centos7中, 其实我测试机安装的是centos6,浪费了好久时间排错。
 
本文永久更新地址:http://www.linuxdiyf.com/linux/28628.html