Installing Modules On cPanel For WHMCS - IonCube, FileInfo & Soap
IonCube
- Go to /opt/cpanel/ea-php81/root/usr/lib64/php/modules (PHP 8.1) and unzip the tar you download from here with the .so file. (The loaders from their website)
- Then in /opt/cpanel/ea-php81/root/etc/php.d (PHP 8.1) put nano 00-ioncube.ini and put in zend_extension = /opt/cpanel/ea-php81/root/usr/lib64/php/modules/ioncube_loader_lin_8.1.so
- Once done, you need to systemctl restart ea-php81-php-fpm.
Soap
- Copy the soap.so file from a normal PHP-8.1 install in the location /usr/lib/php/20210902 (PHP 8.1) and put it into /opt/cpanel/ea-php81/root/usr/lib64/php/modules (PHP 8.1).
- Then in /opt/cpanel/ea-php81/root/etc/php.d (PHP 8.1) put nano 00-soap.ini and put in extension=soap.so
- Once done, you need to systemctl restart ea-php81-php-fpm.
FileInfo
- Login to WHM (Not cPanel client side, WHM's admin side).
- Search for "Software" along the left side and find "EasyApache4".
- Click the button that says Customize next to Currently Installed Packages.
- Click PHP Extensions along the left hand side in blue (3rd option down).
- Search for Fileinfo in the search bar in the top left and click the toggle on the PHP-8.1 version.
- Click Review.
- After looking over the proposed changes, scroll to the bottom of the screen and click provision.
- Once done, you need to systemctl restart ea-php81-php-fpm in terminal.
Referenced from: https://support.cpanel.net/hc/en-us/articles/1500000107181-How-do-I-install-Fileinfo-
If you wish to install extensions for a user of cPanel but don't want to install these extensions globally, follow:
- Example below is for soap extension
- Go into that user with su in terminal or use the cPanel’s terminal page.
- Run pear, this will give you results. Run pear install Archive_Tar to install tar.
- Run pear install PEAR to install Pear required for SOAP to install. Ironic. Lmfao.
- Run pear install soap then install using the channel link.
- Note: You might need to use --force on some of the commands as the tar version of 1.4.14 breaks soap install.
Note: On all instances above, you can restart Apache's FPM in the WHM interface instead of the command by searching "Services" in the top left then finding "Apache FPM".