Last Updated on 22 hours by Sachin G
This article provides a step-by-step guide to upgrade PHP from versions 5.4 or 5.6 to PHP 7.4 on CentOS/RHEL using VestaCP. It involves setting up EPEL and Remi repositories, enabling the PHP 7 repo, updating packages, and restarting services to activate the new version.
In Order to upgrade , we have to install EPEL and Remi repository on our Linux based Operating system.
STEP 1: Click Here to Install EPEL on RHEL / CentOS
STEP2 : Install Remi Repository on Centos 7
Below are the steps to install remi repository on centos 7 or RHEL 7 Server.
# wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm # rpm -Uvh remi-release-7.rpm
STEPS 3 : Install yum utility yum-config-manager
Installing yum utility to use yum config manager to enable remi php version repository.
# yum install yum-utils # yum-config-manager --enable remi-php74
STEPS 4: Updates available package
Below command will search for available updates and this will update the version php .
# yum update -y
After running update command the php version will be update to latest 7.4 . So you have restart your web server services like apache or nginx , then your website will use new version .
STEP 5: Check php Version
[root@panel ~]# php -v
PHP 7.4.4 (cli) (built: Mar 17 2020 10:40:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
I’m Sachin Gupta — a freelance IT support specialist and founder of Tech Transit. I’m certified in Linux, Ansible, OpenShift (Red Hat), cPanel, and ITIL, with over 15 years of hands-on experience. I create beginner-friendly Linux tutorials, help with Ansible automation, and offer IT support on platforms like Upwork, Freelancer, and PeoplePerHour. Follow Tech Transit for practical tips, hosting guides, and real-world Linux expertise!