CentOS 7下,升级VestaCP的PHP版本到PHP 7.0 或 PHP 7.1

之前豆子一直在用vestacp,这款免费面板很好很强大,但是由于官网的php版本只升级到了5.6,还未尝试过7.0的豆子也想自己尝尝鲜。于是就自己动手,升级一下vestacp的php版本。

首先,豆子的vps都是centos 7的系统,所以本教程也只针对centos 7而写。其他系统的,豆子就无能为力了。

第一步:

更新源:

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&yum –enablerepo=remi update remi-release

第二步:

接着停止httpd并删除php默认版本:

service php-fpm stop
service httpd stop
yum -y remove php

第三步:

安装php 7.0或者php 7.1版本

7.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 php70-php-pecl-zip php70-php-snmp -y

7.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

第四步:

安装memcache和opcache

php 7.0命令行:

yum -y –enablerepo=remi-php70 install php-opcache php-memcache

php 7.1命令行:

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

第五步:

重启php-fpm或httpd

Apache版:

service httpd start

Nginx版:

service php-fpm start

也可以reboot重启系统测试一下效果。

到此就全部完成了。

https://www.doublog.com/?p=1705

发表评论

邮箱地址不会被公开。 必填项已用*标注