Introduction
PHP (Hypertext Preprocessor) is a server-side scripting language primarily designed for web development, including websites, web applications, and various projects. A significant advantage of PHP is its ability to be embedded within HTML.
In this guide, we'll install PHP version 8.3. However, you can choose to install a different version by following the provided steps.
Installation Guide
1. Update the System
2. Add Remi RPM Repository
3. Install Yum-Utils
4. Enable Remi RPM Repository
Enable the Remi RPM repository. To install a different PHP version, replace "83" with the desired version number (e.g., php80 or php81):
yum-config-manager --enable remi-php83
5. Update the System Again
- Update the system once more:
6. Install PHP
To install PHP, use this command:
yum install php
7. Verify PHP Installation
Check the PHP installation by running:
php -v
If installed correctly, this command will display information about the installed PHP version.
PHP Extensions
- To install a PHP extension, use the following command (replace "extension_name" with the actual extension you wish to install)
yum install php-extension_name
yum install php-opcache
- To install multiple extensions simultaneously, list them after the "yum install" command:
yum install php-fpm php-curl php-cli php-json php-mysql php-opcache php-dom
- To view all installed PHP extensions, execute:
php -m