How to Install PHP 8.1 on CentOS Stream 9

To install PHP 8.1 on CentOS Stream 9, follow these steps:

Step 1 : Ensure your system is up to date by running the following command:

Step 2 : Install the Remi repository by running the following command:

Step 3 : Check the available PHP modules with the following command:

Step 4 : Enable the Remi repository by running the following command:

Step 5 : Install the PHP core components:

Step 6 : Install commonly used PHP extensions by running the following command:

Explanation of extensions:

- mysqlnd: MySQL Native Driver for PHP.

- curl: Client URL Library for data transfer with URLs.

- gd: Graphics Draw (used for image processing).

- mcrypt: Deprecated encryption library.

- json: JSON (JavaScript Object Notation) support.

- pear: PHP Extension and Application Repository.

- common: Common functionality shared between various PHP extensions.

- xml: Extensible Markup Language support.

- zip: Zip archive management.

- devel: Development files for building PHP extensions.

- xsl: XSL (Extensible Stylesheet Language) support.

- soap: Simple Object Access Protocol support.

- bcmath: Arbitrary precision mathematics.

- mbstring: Multibyte string support.

- gettext: Internationalization functions.

- imagick: ImageMagick PHP extension.

Step 7 : Check the installed PHP version:

Congratulations! You have successfully installed PHP 8.1 on CentOS Stream 9.