To install PHP 7.4 on CentOS Stream 10, you'll need to follow a few simple steps:
Step 1 : Before installing PHP, ensure your system is up to date. Run the following command to update all packages:
Step 2 : The Remi repository provides access to multiple PHP versions. Install it with the following command:
Step 3 : List all available PHP modules to confirm the availability of PHP 7.4:
Step 4 : Enable the PHP 7.4 module in the Remi repository by running:
Step 5 : Install the core components of PHP, including php74, php74-php-fpm, and php74-cli:
Step 6 : Install frequently used PHP extensions to add additional functionality:
- mysqlnd: Enables interaction with MySQL databases.
- curl: Allows you to communicate with different servers using various protocols.
- gd: For handling image creation and manipulation.
- mcrypt: Provides encryption functionality.
- json: Enables JSON encoding and decoding.
- pear: A framework for reusable PHP components.
- common: Contains common files used by PHP.
- xml: For processing XML data.
- zip: Enables handling of ZIP archive files.
- devel: Required for developing PHP applications.
- xsl: Adds support for XSLT transformations.
- soap: For creating and consuming SOAP web services.
- bcmath: Provides support for arbitrary-precision mathematics.
- mbstring: Adds support for multibyte string processing.
- gettext: Enables translation support in PHP.
- imagick: For working with images using the ImageMagick library.
Step 7 : Check the installed PHP version to ensure it is installed correctly:
Congratulations! You've successfully installed PHP 7.4 on CentOS Stream 10.