Introduction
Sometimes PHP scripts require additional modules that need installing that are not included in Easy Apache 4. In these cases, PECL needs to be used.
Procedure
To install a PHP module you use the pecl command, EasyApache 4 includes multiple versions of PHP, so there is a different command for each PHP version as an example here is the PECL location for PHP 7.2 and PHP 7.3:
/opt/cpanel/ea-php72/root/usr/bin/pecl
/opt/cpanel/ea-php73/root/usr/bin/pecl
To install a module, you would use the pecl install command:
/opt/cpanel/ea-php73/root/usr/bin/pecl install xmldiff
In the above example, I installed the PECL package xmldiff. At the end of the installation process the extension is added to the /opt/cpanel/ea-php73/root/etc/php.d/zzzzzzz-pecl.ini file:
[root@source ~]# cat /opt/cpanel/ea-php73/root/etc/php.d/zzzzzzz-pecl.ini
extension="xmldiff.so"
[root@source ~]#
You can confirm the PHP extension was installed using the PHP command through the command line:
[root@source ~]# /opt/cpanel/ea-php73/root/usr/bin/php -m | grep xmldiff
xmldiff
If you're using CloudLinux you will need to update the CageFS filesystem so users will be able to see the extensions:
cagefsctl --update
You can also install PECL modules using the Module installer interface inside WHM:
Comments
0 comments
Article is closed for comments.