How to Install PHP 8.0 on CentOS Stream 10

To install PHP 8.1 on CentOS Stream 10, follow these steps.

Step 1 : Before starting, ensure your system is up to date. Run the following command:

Step 2 : The Remi repository is essential for installing PHP 8.0. Use the following command to add it:

Step 3 : Verify the available PHP modules using:

Step 4 : Enable the PHP 8.0 stream from the Remi repository with this command:

Step 5 : Install PHP 8.0 and its core components, such as php80, php80-php-fpm, and the CLI, by running:

Step 6 : For most applications, you'll need to install commonly used PHP extensions. Use the command below:

- mysqlnd: Native driver for MySQL database interactions.

- curl: Enables PHP to interact with APIs and external resources via HTTP.

- gd: Provides support for image processing.

- mcrypt: Adds encryption and decryption functionality.

- json: Supports JSON encoding and decoding.

- pear: Adds PEAR framework and package management tools.

- common: Includes essential PHP functionalities.

- xml: Enables parsing and manipulation of XML data.

- zip: Facilitates handling of ZIP archives.

- devel: Provides development files for PHP extensions.

- xsl: Enables XSLT processing.

- soap: Adds support for SOAP-based web services.

- bcmath: Provides support for arbitrary precision mathematics.

- mbstring: Handles multibyte strings for internationalization.

- gettext: Adds localization support.

- imagick: Supports image creation and editing using ImageMagick.

Step 7 : After completing the installation, verify that PHP 8.0 is installed by checking its version:

Congratulations! You have successfully installed PHP 8.0 on CentOS Stream 10.