How to Install PHP 8.2 on CentOS Stream 9

To install PHP 8.2 on CentOS Stream 9, follow the steps below.

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

Step 2 : Import the PHP Remi Repository by executing the following command:

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

Step 4 : Enable the PHP Remi Repository:

Step 5 : Install PHP core along with PHP-FPM and CLI:

Step 6 : Install commonly used PHP extensions. Replace the list of extensions with those you require:

Explanation of some extensions:

  • mysqlnd: MySQL Native Driver
  • curl: cURL extension for HTTP requests
  • gd: GD Graphics Library for image creation
  • mcrypt: Deprecated encryption functions
  • json: JSON support
  • pear: PHP Extension and Application Repository
  • common: Common files for PHP
  • xml: XML support
  • zip: Zip archive support
  • devel: Development files for PHP
  • xsl: XSLT support
  • soap: SOAP web services support
  • bcmath: Arbitrary precision mathematics
  • mbstring: Multibyte string support
  • gettext: Gettext support for internationalization
  • imagick: ImageMagick extension

Step 7 : Verify the installed PHP version:

Congratulations, you have successfully installed PHP 8.2 on CentOS Stream 9.