How to Install PHP 8.0 on AlmaLinux 9

To install PHP 8.0 on AlmaLinux 9, follow these steps:

Step 1 : Update the System

Before installing PHP, update your system to ensure all packages are up to date:

Step 2 : Import the PHP Remi Repository

PHP 8.0 is not available in the default AlmaLinux repository, so we need to add the Remi repository:

Step 3 : Check Available PHP Modules

List available PHP versions to confirm that PHP 8.0 is present in the repository:

Step 4 : Enable PHP 8.0 from the Remi Repository

Enable the PHP 8.0 module before installation:

Step 5 : Install PHP 8.0 Core Packages

Now, install the PHP core along with the FastCGI Process Manager (FPM) and command-line interface (CLI):

Step 6 : Install Common PHP Extensions

To ensure PHP supports various features, install commonly used extensions:

- php-mysqlnd – Enables MySQL database support.

- php-curl – Allows PHP to make HTTP requests.

- php-gd – Provides image processing capabilities.

- php-mcrypt – Handles encryption and decryption.

- php-json – Enables JSON support.

- php-pear – Package management for PHP libraries.

- php-common – Provides shared files for PHP.

- php-xml – Enables XML processing.

- php-zip – Supports ZIP file handling.

- php-devel – Required for PHP development and compiling modules.

- php-xsl – Enables XSLT transformations.

- php-soap – Adds SOAP protocol support.

- php-bcmath – Provides precision mathematics functions.

- php-mbstring – Supports multibyte string processing.

- php-gettext – Enables translation and localization support.

- php-imagick – Adds support for image manipulation.

Step 7 : Verify Installation

Check if PHP 8.0 is installed correctly:

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