How To Install PHP 7.4 on CentOS 7

How To Install PHP 7.4 on CentOS 7

2,337

This is a short guide on how to Install PHP 7.4 on CentOS 7 Linux system.


If you're looking for PHP 8.1 visit here.


PHP 7.4 comes with a remarkable amount of new features. This version is RPM are available in the remi-php74 repository for Fedora  29 and Enterprise Linux  7 (RHEL, CentOS) and as Software Collection in the remi-safe repository (or remi for Fedora).

Step 1: Add EPEL and REMI Repository

Run the commands below to add required repositories.

yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm

Step 2: Install PHP 7.4 on CentOS 7

We can now enable PHP 7.4 Remi repository and install PHP 7.4 on CentOS 7.

yum -y install yum-utils
yum-config-manager --enable remi-php74

Install PHP 7.4 on CentOS 7.

yum update
yum install php php-cli

Accept installation prompt by typing y and hit enter

Use the next command to install additional packages:

yum install php-xxx

// Example

yum install php  php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json

The current PHP version should be 7.4.

php -v

Now you have PHP 7.4

- Last updated 1 year ago

Be the first to leave a comment.

You must login to leave a comment