How to install PHP 7.4 on CentOS 8

PHP is a recursive initials PHP Hypertext Preprocessor acronym, is a popular server-side scripting language for Web developers to create powerful and dynamic website.

Step 1: Add EPEL and Remi repository

First, you need to add EPEL & Remi repository, from which you can install PHP 7.4 on CentOS 8 Linux.

To install and enable EPEL repository on CentOS 8, execute the following command dnf.

How to install PHP 7.4 on CentOS 8 

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

How to install PHP 7.4 on CentOS 8

Next, run the following command to add Remi repository.

How to install PHP 7.4 on CentOS 8

Again, in order to verify the existence of Remi repository, run the command.

How to install PHP 7.4 on CentOS 8

Step 2: PHP 7.4 installed on CentOS 8

After successfully added EPEL and Remi repository, execute the following command to get a list of available PHP modules stream.

Remi's Modular repository for Enterprise Linux 8 - x86_64
Name      Stream      Profiles                      Summary                 
php      remi-7.2    common [d], devel, minimal    PHP scripting language   
php      remi-7.3    common [d], devel, minimal    PHP scripting language   
php      remi-7.4    common [d], devel, minimal    PHP scripting language   

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

How to install PHP 7.4 on CentOS 8

From the above output, remi-7.4 is the latest PHP streams, therefore the flow module, as shown below will be enabled.

Transaction Summary
================================================ ================================

sure? [y / N]: y
is completed!

Switching module streams does not alter installed packages (see 'module enable' in dnf(8) for details)

How to install PHP 7.4 on CentOS 8

When you enable PHP remi-7.4 module, you can use the following command to continue and install PHP. This will also install many other packages such as Apache and Nginx module.

How to install PHP 7.4 on CentOS 8

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

How to install PHP 7.4 on CentOS 8

From the output, we can clearly see that we have already installed PHP version 7.4! Now, you can continue to use PHP to test and deploy applications. Now that's it. We hope this guide to help you.

Guess you like

Origin www.linuxidc.com/Linux/2019-11/161300.htm