参考资料

https://www.youtube.com/watch?v=D-wFWUMHcUA&pbjreload=10
http://www.servermom.org/upgrade-vestacp-to-php-7-centos/
https://www.howtoforge.com/tutorial/centos-lamp-server-apache-mysql-php

卸载现有的PHP

yum -y remove php

查看是否安装过webtatic

yum list installed | grep -i web

安装remi源和工具包

rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y install yum-utils
yum -y update

安装php 7.0

yum-config-manager --enable remi-php70

7.1

yum-config-manager --enable remi-php71

7.2

yum-config-manager --enable remi-php72

安装php必须的扩展

yum -y install php php-opcache

重启Vesta和nginx

service nginx restart
service vesta restart

查看现有的php版本

[root@binger ~]# php -v
PHP 7.2.6 (cli) (built: May 23 2018 09:50:51) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.6, Copyright (c) 1999-2018, by Zend Technologies

end