To install PHP 8.1 on CentOS Stream 10, follow these steps.
Step 1 : Start by updating your system to ensure all existing packages are up to date:
Step 2 : Import the Remi repository, which contains the latest PHP versions:
Step 3 : Verify available PHP modules by running the following command:
Step 4 : Enable the Remi repository for PHP 8.1:
Step 5 : Install PHP 8.1 core, PHP-FPM, and CLI:
Step 6 : Next, install common PHP extensions. These extensions provide additional functionality:
- mysqlnd: MySQL Native Driver for PHP, required for MySQL database interactions.
- curl: Enables PHP to interact with remote servers via HTTP requests.
- gd: Used for image processing and manipulation.
- mcrypt: Provides encryption and decryption functionality.
- json: Provides support for JSON data handling.
- pear: PHP Extension and Application Repository, used to manage packages.
- common: General utilities and functions required by PHP.
- xml: Provides XML parsing support.
- zip: Support for handling ZIP archives.
- devel: Development tools for compiling PHP extensions.
- xsl: Support for Extensible Stylesheet Language transformations.
- soap: Web services support in PHP.
- bcmath: Basic math support for arbitrary precision calculations.
- mbstring: Multibyte string support, especially for handling non-Latin characters.
- gettext: Internationalization and localization support.
- imagick: Integration with ImageMagick for advanced image manipulation.
Step 7 : Verify the installed PHP version by running:
Congratulations! You have successfully installed PHP 8.1 on CentOS Stream 10 with the necessary extensions.