Install PHP7, Nginx and MySQL on CentOS/RedHat

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 and now execute one of the following commands as per your operating system version to install Remi repository.

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. 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.

Install PHP Modules

You may also need to install additional PHP modules based on your application requirements. Below command will install some more useful PHP modules. You can run the following command to search other available PHP modules under configured yum repositories. Below example command search for all modules for PHP 7.3.