Add ioncube loader module to Cyberpanel

I recently needed to add the ioncube loader module to my server and I use CyberPanel as a control panel. There are extensions that can be installed in the panel, but this is not one of them. Depending on what version of PHP you use for your website, these are the commands that needed to be run to install.

PHP 8.1

cd /usr/local/

wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

tar -xvf ioncube_loaders_lin_x86-64.tar.gz -C /usr/local

cp ioncube/ioncube_loader_lin_8.1.so /usr/local/lsws/lsphp81/lib/php/20210902/

echo "zend_extension=ioncube_loader_lin_8.1.so" >> /usr/local/lsws/lsphp81/etc/php/8.1/mods-available/01-ioncube.ini 

PHP 8.2

cd /usr/local/

wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

tar -xvf ioncube_loaders_lin_x86-64.tar.gz -C /usr/local

cp ioncube/ioncube_loader_lin_8.2.so /usr/local/lsws/lsphp82/lib/php/20220829/

echo "extension=ioncube_loader_lin_8.2.so" >> /usr/local/lsws/lsphp82/etc/php/8.2/mods-available/01-ioncube.ini

After you have added the module files and configuration changes, you will need to restart the PHP version and then restart the LiteSpeed webserver with this command:

systemctl restart lsws

Add mailparse PHP module to CyberPanel

I recently needed to add the mailparse module to my server and I use CyberPanel as a control panel. So I looked into what needed to be done and it seems like it is really easy. There are extensions that can be installed in the panel, but this is not one of them. Any sort of PECL extension needs to be installed via the command line. Depending on what version of PHP you use for your website, these are the commands that needed to be run to install.

PHP 8.0

/usr/local/lsws/lsphp80/bin/pecl install mailparse

echo "extension=mailparse.so" >> /usr/local/lsws/lsphp80/etc/php/8.0/mods-available/30-mailparse.ini

PHP 8.1

/usr/local/lsws/lsphp81/bin/pecl install mailparse

echo "extension=mailparse.so" >> /usr/local/lsws/lsphp81/etc/php/8.1/mods-available/30-mailparse.ini

PHP 8.2

/usr/local/lsws/lsphp82/bin/pecl install mailparse

echo "extension=mailparse.so" >> /usr/local/lsws/lsphp82/etc/php/8.2/mods-available/30-mailparse.ini

PHP 8.3

/usr/local/lsws/lsphp83/bin/pecl install mailparse

echo "extension=mailparse.so" >> /usr/local/lsws/lsphp83/etc/php/8.3/mods-available/30-mailparse.ini

Once you are done, you will need to restart the PHP version and then restart the LiteSpeed webserver with this command:

systemctl restart lsws