We all already know that CyberPanel is an open-source web hosting control panel that comes with OpenLiteSpeed (a free edition of LiteSpeed). Recently one of our clients contacted us that they were unable to install ionCube Loader 12 on any of the PHP versions. By default, ionCube Loader 10 is available till 7.4.
Without any more delays, let's start with the main point. First of all, log into your CyberPanel and SSH (root, for both). On CyberPanel, at the left sidebar, an option named "Server". You will see the "PHP" option there, click on PHP and a dropdown will be shown: Install PHP Extension - select it. Scroll down the web page, and select desired PHP version where you wish to install the ionCube loader.
After selecting the PHP version, if you see that ionCube loader 10 is already installed, please uninstall it to prevent any incidents.
Now, open Terminal with SSH using Bitvise SSH Client or, other SSH client software. Run the following command:
wget -N https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.zip
unzip -o ioncube_loaders_lin_x86-64.zip
cd ioncube && chmod +x *.so && ls
Now copy the ionCube loader 12 (compiled .so files) to each of the PHP versions we require!
cp ioncube_loader_lin_7.1.so /usr/local/lsws/lsphp71/lib64/php/modules
cp ioncube_loader_lin_7.2.so /usr/local/lsws/lsphp72/lib64/php/modules
cp ioncube_loader_lin_7.3.so /usr/local/lsws/lsphp73/lib64/php/modules
cp ioncube_loader_lin_7.4.so /usr/local/lsws/lsphp74/lib64/php/modules
cp ioncube_loader_lin_8.1.so /usr/local/lsws/lsphp81/lib64/php/modules
Once all of the files are copied successfully, we need to modify the master php.ini file of each PHP version in order to enable ionCube loader 12:
nano /usr/local/lsws/lsphp81/etc/php.ini
At the first/end (as your own wish) of the file, add the following line:
zend_extension = "/usr/local/lsws/lsphp81/lib64/php/modules/ioncube_loader_lin_8.1.so"
Save changes, and perform the same with other PHP versions. Make sure to replace the PHP version at "zend_extension". That's all, you've learned how to! Feel free to contact us if you need further help!