Welcome to today’s guide on how to install PHP 7.4 on CentOS 8 / RHEL 8 Linux system. The PHP Version 7.4.0 has been released for the developers, and users interested in running it in production. The official release date for GA was November 28, 2019.

Follow the steps below to Install PHP 7.4 on CentOS 8 / RHEL 8 Linux system. PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. Popular web CMS platforms like WordPress are written in PHP.

Step 1: Add EPEL and REMI Repository

EPEL and REMI repositories are the main requirements for this installation. Add them to the system by running these commands:

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

Step 2: Install PHP 7.4 Packages

Once the repositories are added, We can enable PHP 7.4 Remi module and install PHP 7.4 on CentOS 8 / RHEL 8.

sudo dnf -y install dnf-utils

Enable the module stream for PHP 7.4 on CentOS 8 / RHEL 8.

sudo dnf module reset php -y
sudo dnf module install php:remi-7.4 -y

Accept installation prompt.

...
Transaction Summary
========================================================================================================================================================================================================
Install  10 Packages

Total download size: 8.7 M
Installed size: 42 M
Is this ok [y/N]:  y

The current PHP version should be 7.4.

$ php -v
HP 7.4.33 (cli) (built: Feb 14 2023 09:19:40) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

Step 3: Install PHP 7.4 Extensions

Use the next command to install additional packages:

sudo dnf update
sudo yum install php-xxx

Example:

sudo yum install wget php-{pear,cgi,common,curl,mbstring,gd,mysqlnd,gettext,bcmath,json,xml,fpm,intl,zip,imap}

Proceed to install commonly used PHP extensions in your system

...
Transaction Summary
========================================================================================================================================================================================================
Install  36 Packages

Total download size: 23 M
Installed size: 72 M
Is this ok [y/N]: y

To view enabled modules, run:

$ php --modules
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imap
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
zip
zlib

[Zend Modules]

You have successfully installed PHP 7.4 on CentOS 8 / RHEL 8.

Similar:

Install PHP 7.4 on Ubuntu

How To Install PHP 7.4 on Fedora

How To Install PHP 7.4 on CentOS 7

How To Install PHP 7.4 on Debian

How To Install PHPUnit on CentOS / Fedora

YOU CAN SUPPORT OUR WORK WITH A CUP OF COFFEE


As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.

LEAVE A REPLY

Please enter your comment!
Please enter your name here