PHP is a server side scripting language that is embedded in HTML. It is used to manage dynamic content, databases, session tracking, even build entire e-commerce sites. It is integrated with a number of popular databases, including MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server.
Remi, a third-party repository which offers multiple versions of PHP 7.X,
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
Install the Remi repository by using the below command,
yum install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm
Check the available PHP modules by using following command,
yum module list php
NOTE: In this example we are installing PHP 7.4.
PHP:remi-7.4 module to install PHP 7.4
yum module enable php:remi-7.4 -y
Now that the PHP version has been set, we will install PHP by running the below command,
yum install -y php php-cli php-common
Once you have installed PHP, check the PHP version
This concludes our topic of installing php 7.4 on CentOS Stream 9 system.