Menu
User

DropVPS Team

Writer: John hens

How to Install PHP 8.3 RHEL 9/8

How to Install PHP 8.3 RHEL 9/8

Publication Date

09/17/2025

Category

Articles

Reading Time

2 Min

Table of Contents

PHP is one of the most widely used scripting languages for web development. On Red Hat Enterprise Linux (RHEL) 9/8 Installing PHP is straightforward when you use the system’s package manager.

Step 1: Update Your System

Before installing PHP, make sure your Red Hat system is up to date. This ensures you get the latest security patches and package versions:

sudo dnf update -y

Step 2: Enable the EPEL and Remi Repositories

Red Hat does not always ship the latest PHP version in its default repositories. To get newer versions, you should enable EPEL (Extra Packages for Enterprise Linux) and Remi repositories:

sudo dnf install -y epel-release
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm

(Replace 9 with 8 if you are on RHEL 8.)

Step 3: Enable the Desired PHP Module

Red Hat uses the modular system for software versions. You need to enable the PHP module you want. For example, if you want PHP 8.3:

sudo dnf module reset php -y
sudo dnf module enable php:remi-8.3 -y

This ensures your system will install PHP 8.3 from the Remi repository.

Step 4: Install PHP

Now install PHP along with common extensions that most applications require:

sudo dnf install -y php php-cli php-mysqlnd php-fpm php-json php-zip php-gd php-mbstring php-curl php-xml

This command installs the PHP core and widely used extensions for databases, JSON, and web applications.

Step 5: Verify PHP Installation

After the installation completes, check that PHP is installed and confirm the version:

php -v

If everything is set up correctly, you will see the installed PHP version along with build details.

Linux VPS
U
Loading...

Related Posts