Knowledge Base
MilesWeb / cPanel, How-Tos, Web Host Manager

How to Install Multiple PHP Extensions using PECL via SSH?

Approx. read time : 2 min

When doing PHP configurations to Linux hosting, you may have to install PHP extensions for all versions. To do that, you will have to run the installer for each individual version.

To Install a PHP Extension

1. Install a PHP module by running the pecl command:

EasyApache 4 offers multiple versions of PHP. The command for each PHP version is different as shown in the above example with the PECL location for PHP 7.2 and PHP 7.3.

2. Install a module using the pecl install command:

To Install Multiple PHP Extensions

Loop through each PHP version and run the installer with the command:

The code you see above is to loop through PHP versions from 72 through 80 while installing xmldiff for each of them.

You can take that as an example to install a single PHP extension or multiple PHP extensions at once using PECL on a Linux server.

Prasad Khartadkar
Prasad is a business grad specialized in Marketing. He has garnered experience as a technical content writer and a digital marketer that he brings out in his work. He likes reading classics and travel in his free time.