Currently, the yum repo configured on VPS does not support php7 installation. Therefore, we need to compile the source code and install the dependency extension. this is very troublesome, however, a PHP developer from France maintains a yum source that provides the latest php7 compilation version. directly configure this source, we can install the latest php7 version.
Configuration method on Centos7:
# Yum install epel-release # rpm-ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
Configuration method on Centos6;
# Rpm-Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
# Rpm-Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
After configuration, you need to specify the source when installing php7, just like this;
# Yum install-enablerepo = remi-php70-y php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd
This is the example of installing php7 and its extension, and installing php5.6 is replaced with-enablerepo = remi-php56, before installation, you can use yun info-enablerepo = remi-php70 php to confirm the php version.
For details about the installation method, see the following references:
Http://www.servermom.org/how-to-enable-remi-repo-on-centos-7-6-and-5/2790/
Http://www.servermom.org/install-and-enable-epel-repo-on-centos-7/2780/
Http://blog.remirepo.net/post/2016/04/16/My-PHP-Workstation
Http://www.zabbix.cc/technic/1420/