How to Upgrade PHP 5.6 to PHP 7.3 on CentOS VestaCP

by Sandy

In this tutorial I’ll show you how to upgrade PHP 5.6.xx which is by default installed by Vesta CP during installation to PHP 7.3.xx latest, I’ve tested on many server before writing this tutorial and its just working fine without any issue hence it is safe to upgrade to PHP 7.3 please be sure your script is compatible with php 7.3, part of this tutorial is copied from remi repository.

Why upgrade to php 7.3 –  Because it will give you security & performance boost + KICK, since WordPress will load much faster and uses less resources. And php 7.3 is 5% faster than any other previous version.

Upgrade to php 7.2https://www.mysterydata.com/upgrade-php-5-6-php-7-2-centos-vesta-cp/

STEP 1 :

Install Remi Repository and EPEL Repository on your server :

RHEL 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
subscription-manager repos --enable=rhel-7-server-optional-rpms

RHEL 6

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm
rhn-channel --add --channel=rhel-$(uname -i)-server-optional-6

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

CentOS 6

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm

STEP 2 :

After you have installed repository you need to follow some extra configurations :

Run this command one by one for RHEL or CentOS

yum install yum-utils
yum-config-manager --enable remi-php73

 STEP 3 :

Now just run this command :

yum update -y

You’ll see php packages are getting updated, After the update process you need to restart Apache server/php-fpm-(nginx) and check the php version from by below mentioned command:

php -v
[root@server ~]# php -v
PHP 7.3.0 (cli) (built: Dec  4 2018 16:12:20) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.0, Copyright (c) 1999-2018, by Zend Technologies

Troubleshoot

If php upgrade process fails (no update/nothing happens) or you upgraded previously from 5.6 to 7.0/7.1/7.2 then you need to run this commands to disable php 5.6/7.0/7.1/7.2 :

yum-config-manager --disable remi-php56
yum-config-manager --disable remi-php70
yum-config-manager --disable remi-php71
yum-config-manager --disable remi-php72

After that follow the tutorial from STEP 2 again.

If this post helps you in any way please consider a donation

Donate with PayPal :

md-donate

Donate with Paytm :

md-donate

You may also like

9
Leave a Reply

avatar
8 Comment threads
1 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
9 Comment authors
SandyfarasDilmaxChrisNikolay Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Tieu Tan Tan
Guest

Your guide is high quality and worked well, I have been bookmarking this website. Thank you!

Alfred
Guest

Very good guide to upgrade to php7.3 Thanks

Artist
Guest

Thank you. It works!

Matt
Guest
Matt

can you make guide to update on VestaCP Debian 9 PHP to 7.3?

Nikolay
Guest
Nikolay

Yes, my upgrade is the correct complete.

Chris
Guest
Chris

I think this is a good article but it is a bad practice to simply do “yum update -y”. As this updates *every* package on your machine, it may cause unexpected problems with other packages. I’d strongly recommend to make that an update of the relevant packages only.

Good job though 😉

Dilmax
Guest

Great Work, this is working.
Can you please tell me how to switch between php 5.6 and 7.3? Is it possible?

faras
Guest

i have instslled php 7.3 but in mariadb 10.3 i see detail used php 5.6 so my script not compatible with vestacp . before scrpt php sql work with cpanel whm