On CentOS 7 VestaCP install PHP 5.6 by default. This is very old version of PHP. To upgrade PHP to latest version 7.x, you can install remi repo.
Install EPEL repo
yum install -y epel-release
Install yum-utils
yum install -y yum-utils
Install remi repo
rpm -ivh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Select PHP version you need
yum-config-manager --enable remi-php73
Here i selected PHP 7.3. You can select differnt PHP versions with commands like.
yum-config-manager --enable remi-php56 yum-config-manager --enable remi-php71 yum-config-manager --enable remi-php72 yum-config-manager --enable remi-php73 yum-config-manager --enable remi-php74
Make sure you only enable one PHP version. If you enabled a PHP version from remi repo, disable it with
yum-config-manager --disable remi-php56 yum-config-manager --disable remi-php70 yum-config-manager --disable remi-php71 yum-config-manager --disable remi-php72 yum-config-manager --disable remi-php73 yum-config-manager --disable remi-php74
Once you have desired version enabled, run yum upgrade
yum upgrade
Or only for PHP, run
yum upgrade php*
Leave a Reply