How to Install PHP 7.3 on CentOS 7 Using Remi Repository

   

PHP 7.3 is a popular version of PHP known for its performance improvements and new features. If you're using CentOS 7 and want to install PHP 7.3, you can do so easily by using the Remi repository. This guide will walk you through the process step by step using the provided commands.

Prerequisites

Before you begin, ensure you have:

- Access to a terminal with sudo privileges.

- A CentOS 7 server or system.

Steps to Install PHP 7.3 on CentOS 7

Follow these steps to install PHP 7.3 on CentOS 7 using the provided commands:

1. Install wget (if not already installed)

If you don't have wget installed on your system, you can install it using the following command:


sudo yum -y install wget

2. Download and Enable Remi Repository

Next, download and enable the Remi repository by running the following commands:


sudo wget -q https://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm

3. Install yum-utils

Install yum-utils, which provides the yum-config-manager utility, using the following command:


sudo yum -y install yum-utils

4. Enable PHP 7.3 Repository

Enable the PHP 7.3 repository within the Remi repository:


sudo yum-config-manager --enable remi-php73

5. Install PHP 7.3 and Required Extensions

Finally, install PHP 7.3 and necessary PHP extensions using the following command:


sudo yum -y install php-opcache php-pecl-apcu php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongodb php-pecl-redis php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml

This command will install PHP 7.3 along with commonly used PHP extensions.

6. Verify PHP Installation

Once the installation is complete, verify that PHP 7.3 is installed correctly by running:


php -v

You should see output similar to the following:


PHP 7.3.x (cli) (built: Month Day Year Time) ( NTS )

Congratulations! You have successfully installed PHP 7.3 on CentOS 7 using the Remi repository.

Conclusion

Installing PHP 7.3 on CentOS 7 using the Remi repository is a straightforward process. By following the steps outlined in this guide and using the provided commands, you can quickly set up PHP 7.3 and start using it for your web development projects. Remember to keep your PHP installation updated to ensure compatibility and security.