To install PHP 8.0 on CentOS Stream 9, follow the steps below.
Step 1 : Ensure your system is up to date by running the following command:
Step 2 : Install the Remi repository for PHP 8.0 by running:
Step 3 : Verify available PHP modules with the following command:
Step 4 : Enable the PHP Remi repository with the following command:
Step 5 : Install PHP core components:
Step 6 : Install commonly used PHP extensions with the following command:
Explanation of extensions:
- mysqlnd: MySQL Native Driver
- curl: cURL extension for URL handling
- gd: GD Graphics Library for image processing
- mcrypt: Deprecated encryption extension (consider alternatives)
- json: JSON support
- pear: PHP Extension and Application Repository framework
- common: Common files for PHP
- xml: XML support
- zip: Zip archive support
- devel: Development tools
- xsl: XSL extension for XML processing
- soap: SOAP extension for web services
- bcmath: BCMath arbitrary precision mathematics
- mbstring: Multibyte support
- gettext: Gettext support for internationalization
- imagick: ImageMagick extension for image processing
Step 7 : Check the installed PHP version with:
Congratulations, you have successfully installed PHP 8.0 on CentOS Stream 9!