To confirm the presence of the EPEL repository, run the following rpm command.

# rpm -qa | grep epel

Confirm EPEL Installation

Next, run the command below to add the Remi repository.

# dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

Install Remi Repo on CentOS 8

Once again, to verify the existence of the Remi repository, run the command.

# rpm -qa | grep remi

Confirm Remi Repo Installation

Step 2: Install PHP 7.4 on CentOS 8

Upon successful addition of EPEL and Remi repositories, execute the command below to get a list of available PHP module streams.

# dnf module list php

List PHP Modules

From the output above, remi-7.4 is the latest PHP stream, and therefore we are going to enable the module stream as shown below.

# dnf module enable php:remi-7.4

Enable PHP Remi Stream

Once the PHP remi-7.4 module has been enabled, you can then proceed and install PHP using the command below. This will also install a host of other packages such as Apache and Nginx modules.

# dnf install php php-cli php-common

Install PHP on CentOS 8

To check the version of PHP installed, run the command.

# php -v

Verify PHP Installed Version

From the output, we can clearly see that we have installed PHP version 7.4! You can now proceed to test and deploy your applications using PHP. And that’s just about it for now. We do hope you found this guide helpful.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

This is James, a certified Linux administrator and a tech enthusiast who loves keeping in touch with emerging trends in the tech world. When I'm not running commands on the terminal, I'm taking listening to some cool music. taking a casual stroll or watching a nice movie.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.