Learn how to – How To Install PHP 7.4 on CentOS 8 / RHEL 8.
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 on CentOS 8 / RHEL 8
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.
Dependencies resolved.
========================================================================================================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================================================================================================
Installing group/module packages:
php-cli x86_64 7.4.33-4.el8.remi remi-modular 4.6 M
php-common x86_64 7.4.33-4.el8.remi remi-modular 1.2 M
php-fpm x86_64 7.4.33-4.el8.remi remi-modular 1.6 M
php-mbstring x86_64 7.4.33-4.el8.remi remi-modular 529 k
php-xml x86_64 7.4.33-4.el8.remi remi-modular 218 k
Installing dependencies:
httpd-filesystem noarch 2.4.37-54.module_el8.8.0+1256+e1598b50 appstream 42 k
libxslt x86_64 1.1.32-6.el8 baseos 250 k
oniguruma5php x86_64 6.9.8-1.el8.remi remi-safe 212 k
php-json x86_64 7.4.33-4.el8.remi remi-modular 80 k
Installing weak dependencies:
nginx-filesystem noarch 1:1.14.1-9.module_el8.0.0+1060+3ab382d3 appstream 24 k
Installing module profiles:
php/common
Enabling module streams:
httpd 2.4
nginx 1.14
php remi-7.4
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 CentOS 8 / RHEL 8
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:
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
Leave a Reply
You must be logged in to post a comment.