To install PHP 8.4 on AlmaLinux 9, follow these steps:
Step 1 : Update System Packages
Before installing PHP, update your system to ensure all packages are up to date:

Step 2 : Import PHP Remi Repository
The Remi repository provides the latest PHP versions. Install it using the following command:

Step 3 : Check Available PHP Modules
Run the following command to list available PHP versions in the Remi repository:

Step 4 : Enable PHP 8.4 Remi Repository
Enable the PHP 8.4 module from the Remi repository:

Step 5 : Install PHP 8.4 Core Packages
Now, install PHP 8.4 and essential components:

Step 6 : Install Commonly Used PHP Extensions
To enhance PHP functionality, install the following extensions:

- mysqlnd – Enables MySQL database connectivity.
- curl – Allows PHP to communicate with external APIs.
- gd – Required for image processing.
- mcrypt – Provides encryption functionalities.
- json – Enables JSON data handling.
- pear – PHP package manager.
- common – Standard PHP libraries.
- xml – XML processing support.
- zip – Handles ZIP archives.
- devel – Development files for compiling extensions.
- xsl – XSLT support for XML transformations.
- soap – Enables SOAP-based web services.
- bcmath – Arbitrary precision mathematics.
- mbstring – Multibyte string support.
- gettext – Internationalization support.
- imagick – Image manipulation using ImageMagick.
Step 7 : Verify Installation
Check the installed PHP version to confirm the installation:

Congratulations! You have successfully installed PHP 8.4 on AlmaLinux 9.