Configure Yum Repository
First of all, you need to enable Remi and EPEL yum repositories on your system. Use the following command to install EPEL repository on your CentOS and Red Hat 7/6 systems
Use this command to install epel-release yum repository
yum install epel-release
and now execute one of the following commands as per your operating system version to install Remi repository.
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Install PHP 7 on CentOS 6
Your system is prepared for the PHP installation from yum repositories. Use one of the following commands to install PHP 7.3 or PHP 7.2 or PHP 7.1 on your system based on your requirements.
## Install PHP 7.3 yum --enablerepo=remi-php73 install php
## Install PHP 7.2 yum --enablerepo=remi-php72 install php
## Install PHP 7.1 yum --enablerepo=remi-php71 install php
I have installed the latest version PHP 7.3 on my system. Now running the following command to check current active PHP version on my system.