Set up PHP ionCube Loader on Debian 11

In this guide, you will learn to Set up PHP ionCube Loader on Debian 11.

If you want to encrypt your PHP codes, it is the best choice to use the ionCube loader. It is compatible with both small and enterprise-level applications. This tutorial will show you how to install it on your Debian 11.

Steps To Set up PHP ionCube Loader on Debian 11

To install ionCube on Debian 11, you must log in to your server as a root user. For this purpose, you can visit the Initial Server Setup with Debian 11.

Now follow the steps below to complete this guide.

Step 1 – Apache Installation on Debian 11

The first step is to install the Apache web server on Debian 11. First, run the system update with the following command:

apt update

Then, use the command below to install Apache:

apt install apache2 -y

When your installation is completed, proceed to the next step.

Step 2 – PHP Installation on Debian 11

To install ionCube, you must have PHP 8.1 installed on your server. To install PHP 8.1, you can visit the following guide, you just need to visit the PHP installation with the Apache module:

How To Set up PHP 8.1 on Debian 11

When your installation is completed, verify your PHP version:

php --version
Output
PHP 8.1.18 (cli) (built: May 17 2023 15:59:20) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.18, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.18, Copyright (c), by Zend Technologies

Step 3 – Download the ionCube Loader

At this point, you need to visit the ionCube loader downloads page and get the Linux tar.gz package depending on your OS (32/64 bits) by using the following wget command:

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

When your download is completed, extract it by using the following command:

tar xzf ioncube_loaders_lin_x86-64.tar.gz

Then, use the following command to list the content of the ionCube directory on Debian 11:

ls ioncube
Output
ioncube_loader_lin_4.1.so     ioncube_loader_lin_5.6_ts.so
ioncube_loader_lin_4.2.so     ioncube_loader_lin_7.0.so
ioncube_loader_lin_4.3.so     ioncube_loader_lin_7.0_ts.so
ioncube_loader_lin_4.3_ts.so  ioncube_loader_lin_7.1.so
ioncube_loader_lin_4.4.so     ioncube_loader_lin_7.1_ts.so
ioncube_loader_lin_4.4_ts.so  ioncube_loader_lin_7.2.so
ioncube_loader_lin_5.0.so     ioncube_loader_lin_7.2_ts.so
ioncube_loader_lin_5.0_ts.so  ioncube_loader_lin_7.3.so
ioncube_loader_lin_5.1.so     ioncube_loader_lin_7.3_ts.so
ioncube_loader_lin_5.1_ts.so  ioncube_loader_lin_7.4.so
ioncube_loader_lin_5.2.so     ioncube_loader_lin_7.4_ts.so
ioncube_loader_lin_5.2_ts.so  ioncube_loader_lin_8.1.so
ioncube_loader_lin_5.3.so     ioncube_loader_lin_8.1_ts.so
ioncube_loader_lin_5.3_ts.so  LICENSE.txt
ioncube_loader_lin_5.4.so     loader-wizard.php
ioncube_loader_lin_5.4_ts.so  README.txt
ioncube_loader_lin_5.5.so     USER-GUIDE.pdf
ioncube_loader_lin_5.5_ts.so  USER-GUIDE.txt
ioncube_loader_lin_5.6.so

Step 4 – Enable ionCube Loader in PHP on Debian 11

At this point, you need to find the location of the extension directory. To do this, you can use the following command:

php -i | grep extension_dir
Output
extension_dir => /usr/lib/php/20210902 => /usr/lib/php/20210902

Next, copy the ionCube loader module from the ionCube directory that matches your PHP version to the PHP extension directory:

cp ioncube/ioncube_loader_lin_8.1.so /usr/lib/php/20210902

Then, you need to enable the ionCube loader by editing the php.ini file. You can use your favorite text editor, here we use the vi editor:

vi /etc/php/8.1/cli/php.ini

Add the following line at the end of the file:

zend_extension = /usr/lib/php/20210902/ioncube_loader_lin_8.1.so

When you are done, save and close the file.

Finally, restart Apache to apply the changes:

systemctl restart apache2

Step 5 – Verify ionCube PHP Loader on Debian 11

At this point, you can verify your ionCube loader PHP module by checking the PHP version:

php -v

If everything is fine, you should get the following output:

Output
PHP 8.1.18 (cli) (built: May 17 2023 15:59:20) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.18, Copyright (c) Zend Technologies
    with the ionCube PHP Loader v12.0.5, Copyright (c) 2002-2022, by ionCube Ltd.
    with Zend OPcache v8.1.18, Copyright (c), by Zend Technologies

Also, you can use the following command:

php -m
Output
...
[Zend Modules]
Zend OPcache
the ionCube PHP Loader

The above output confirms that the PHP ionCube extension is loaded on your server.

Conclusion

At this point, you have learned to Set up the ionCube PHP loader on Debian 11 by installing Apache and PHP 8.1, downloading ionCube for Linux, and enabling it in your PHP.

You can easily use the ionCube loader to encrypt your PHP code in your applications.

Hope you enjoy it. You may be interested in these articles on the orcacore website:

How To Install OpenSSL 3 on Debian 11

How To Install OpenJDK 19 on Debian 11

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Stay informed and not overwhelmed, subscribe now!