In this article, we have explained how to install the ionCube loader module for PHP 8.0 in cPanel. If you want to encrypt PHP code in your application, ionCube is an excellent option. Using ionCube allows you to run your PHP source code through their PHP encoder before distributing an application, which prevents the code from being human-readable.
By default, PHP code that has been encrypted/encoded in this manner cannot be executed directly on your server; this is where the ionCube loader comes in to ensure that the PHP engine can process and run your code.
In this article, you will learn how to install the ioncube_loader module for PHP 8.0 in cPanel.
Let’s get in brief about the ionCube loader. So, without further ado, here we go:
What is an ionCube loader?
A PHP module called the ionCube loader may load PHP files that have been encrypted. Doing this can prevent people from stealing and altering your scripts. The loader may be installed into a PHP installation and is freely redistributable. It is provided as a PHP extension module for Windows, Linux, and macOS.
PHP scripts are encoded using the open-source yet proprietary ionCube PHP Loader. It was produced by ionCube and is offered as both freeware and paid software. The PHP script is encrypted by the loader so that it can only be run in conjunction with a file that has been IonCube-encoded and contains a decryption key. The loader makes it simple to shield the PHP scripts on your website from unauthorized access, theft, or modification.
Installing the ionCube Loader module for PHP 8.0 or 8.1 in cPanel
The ioncube_loader is unavailable for PHP8.0, and they are unwilling to release support for this version as explained by the proprietor ionCube blog. However, cPanel supports ionCube on a prior PHP version, 7.4, and will support the most recent version, PHP 8.1. Nevertheless, by default cPanel still does not have ionCube for PHP 8.1, and many big hosting companies such as Godaddy still do not have this available by default for PHP 8.1 as of writing. The license for the new ionCube encoder 12 for any platform which supports PHP 8.1 can also be purchased from ioncube.com.
Of course, the recently released PHP 8.1 is popular this year. It’s the newest and most exciting advancement in the PHP community, and with a good cause. Numerous intriguing new features were added to PHP 8.1. Some of these are fundamental, incompatible modifications that don’t work with earlier PHP versions (most notably PHP 8.0). So, we can say that the new ionCube still has to go through many updates before it is fully adopted for PHP 8.1 by cPanel and various hosting companies.
Kinsta hosting has already been providing ionCube for PHP 8.1. Many other hosting providers still have not included the latest ionCube in their hosting plan, so if you have a hosting account with root access such as cloud VPS, then you can install the ionCube yourself. In the next paragraph, we are going to explain, how you can install it in Ubuntu for PHP 8.1.
If every function on your website operates well with PHP 8.1, there is no reason not to update. Therefore, you can install it in PHP version 8.1.
How to install the ioncube_loader module for PHP 7.4 in GoDaddy cPanel
You must be aware of the PHP version your website is using before you can start installing the ionCube loader. Therefore, you must ensure that you install the 7.4 or 8.1 version of ionCube according to the PHP version your website is using.
You must follow specific steps to install the ionCube loader on your server manually. Install ionCube on your cPanel hosting account by following these steps:
- Navigate to your GoDaddy product page.
- Click Manage next to the Linux Hosting account you want to use in Web Hosting.
- Click cPanel Admin in the account Dashboard.
- Select PHP Version from the cPanel Home page’s Software section.
- Select the box for ioncube_loader in the list of PHP extensions as shown in image 1A above, and then click Save.
How to install the ioncube_loader module for PHP 8.1 in Ubuntu
This method is applicable to those who have root access to the hosting server and who can run terminal commands. First, get the download link for your Linux from here. There are two versions available: one for 32-bit and the other for 64-bit OS.
1. First, go to the temp folder and download the ionCube archive using the following command.
$ cd /tmp $ wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
2. Once it is downloaded, use the tar command to extract it.
$ tar xvfz ioncube_loaders_lin_x86-64.tar.gz $ sudo rm -rf ioncube_loaders_lin_x86-64.tar.gz
3. Go to the ioncube folder and list all of its contents. It will look something as shown in the next image.
$ cd ioncube/ $ ls -la
4. Now type the next command to find the correct version of PHP, your hosting server is using.
$ php -v
5. Now as per our hosting setup we are using PHP 8.1, so we need ioncube for the same and that is shown in the image of step 3 above. The following two files
..... ioncube_loader_lin_8.1.so ioncube_loader_lin_8.1_ts.so .....
6. Now this is the final most important step. We need to append this file ioncube_loader_lin_8.1.so directive to the php.ini file. For that, we need to first copy the file to a permanent location because we loaded it in a temp folder. The best place to move this file is the PHP extensions’ library.
You can find the library of the PHP extensions by typing the following command. Each server configuration may have different locations, for example server with cPanel software usually have the folder /opt/cpanel/ea-php81/root/usr/lib64/php/modules and server installed by one click OpenLiteSpeed uses the folder location at /usr/local/lsws/lsphp81/lib/php/20210902. The following command shows the location in the Apache web server and most common PHP installation environment.
[email protected]:~# php -i | grep extension_dir extension_dir => /usr/lib/php/20210902 => /usr/lib/php/20210902 [email protected]:~#
copy the ioncube_loader_lin_8.1.so file to this PHP extension library folder using the following command.
$ sudo cp /tmp/ioncube/ioncube_loader_lin_8.1.so /usr/lib/php/20210902
7. Now just add the following line at the end of the php.ini file. You must find the currently in-use PHP.ini file location. For that, you can upload/create a phpinfo.php file with simple content <?php phpinfo(); ?> to the root folder of your web server. and access the file using its live public URL, such as http://ip-address-ordomain.com/phpinf.php. it will show its location.
In the above setup, we found that the php.ini is loaded from location “/etc/php/8.1/fpm/php.ini” that is a case of php-fpm. In your case, it could be a different location such as ” /etc/php/8.1/apache2/php.ini ” or /etc/php/8.1/cli/php.ini. So no matter, where your php.ini file is located, simply find the file location and edit the file to add the location of the ionCube_loader extension.
So let’s edit the file using nano editor. use the correct command with the php.ini location in your hosting.
$ nano /etc/php/8.1/apache2/php.ini #for Apache and PHP config $ nano /etc/php/8.1/fpm/php.ini #for Apache and PHP-FPM config $ nano /etc/php/7.0/cli/php.ini #for PHP CLI $ nano /usr/local/lsws/lsphp81/etc/php/8.1/litespeed/php.ini #for Apache and PHP config
8. Finally, add the file location in the end of your php.ini file.
zend_extension = /usr/lib/php/20210902/ioncube_loader_lin_8.1.so OR zend_extension = /opt/cpanel/ea-php81/root/usr/lib64/php/modules/ioncube_loader_lin_8.1.so OR zend_extension = /usr/local/lsws/lsphp81/lib/php/20210902/ioncube_loader_lin_8.1.so
That’s it. Just make sure you put the correct path for the ionCube_loader. Next, save and exit the file by pressing CTRL+X and then choose Y to confirm saving. Hit enter and you are done installing ionCube_loader module. Finally, restart the webserver to make the changes effective. use one of the following commands to restart your webserver.
$ systemctl restart apache2 # in case of Apache Server $ systemctl restart php8.1-fpm # in case of PHP FPM $ systemctl restart nginx # in case of nginx server $ /usr/local/lsws/bin/lswsctrl restart # in case of openlitespeed server $ sudo service httpd restart # in case of cPanel with Apache and httpd server
Hopefully, you’ve installed and configured the ionCube_loader module for PHP 8.1 in cPanel or Ubuntu linux. We discovered that the ionCube_loader is a PHP plugin with a specific function to instantly decrypt previously encrypted PHP files whenever the server requests them.
You may like to Read: What Is Virtualization In Cloud Computing?
Ans- PHP scripts are encoded using the open-source yet proprietary ionCube PHP Loader. It was produced by ionCube and is offered as both freeware and paid software. The PHP script is encrypted by the loader so that it can only be run in conjunction with a file that has been IonCube-encoded and contains a decryption key. The loader makes it simple to shield the PHP scripts on your website from unauthorized access, theft, or modification.
Ans- You must follow specific steps to install the ionCube loader on your server manually. Install ionCube on your cPanel hosting account by following these steps:
Navigate to your GoDaddy product page.
Click Manage next to the Linux Hosting account you want to use in Web Hosting.
Click cPanel Admin in the account Dashboard.
Select PHP Version from the cPanel Home page’s Software section.
Select the box for ioncube_loader in the list of PHP extensions, and then click Save.