What is IonCube?
IonCube gives developers the opportunity to protect their code that is written in the PHP programming language. IonCube prevents this code from being viewed, edited, and run on unlicensed systems. This works by IonCube compiling the bytecode before encoding, so that the source code is eliminated. Runtime overheads are also reduced.
You will need…
-
Ubuntu Server 14.04 LTS – with a LAMP stack installed (Linux, Apache, MySQL and PHP).
-
An SCP connection to your server – as root. In this case, I will be connecting from Windows using WinSCP.
-
An open ssh connection to your server as root.
How to install IonCube
-
Download the latest version of the IonCube Loader Wizard from the official site.
-
In the ssh window, identify the contents of your PHP modules folder.
php -i | grep extension_dir
-
You will see an output that looks something like the following. Jot this down.
extension_dir => /usr/lib/php5/20090626+lfs => /usr/lib/php5/20090626+lfs
-
Inside the
.zip
that you downloaded from the IonCube website, there is a folder calledIonCube
. Upload that whole folder to your webroot at /var/www/html
using the SCP connection. Alternatively, you could use wget to place it in that folder, using these commands:cd /var/www/html mkdir ioncube cd ioncube wget http://www.ioncube.com/loader-wizard/loader-wizard.tgz tar -xzf loader-wizard.tgz
-
Using your web browser, navigate to
http://<yourip>/ioncube/loader-wizard.php
. -
Wait for the website to load. It will prompt you to select a hosting option.
-
Select the “Dedicated/VPS server” option and fill in the “Company details” with:
Name: Vultr Address: https://www.vultr.com
-
IonCube will prompt you to copy a file from the folder that you have just uploaded to another folder on the VPS. Do that using the WinSCP connection. You may find it easier to download and re-upload the file. The directory that it has told you should be the PHP extensions directory that we found earlier.
-
The bottom of the webpage will show you a link to a file called
20-ioncube.ini
. -
Download that file and open it in your favorite text editor. It will contain one line that is very similar to this:
zend_extension = /usr/lib/php5/20121212/ioncube_loader_lin_5.5.so
-
Back in the ssh connection, enter this command to locate the
php.ini
file:php -i | grep 'Configuration File'
The output will appear similar to:
Configuration File (php.ini) Path => /etc Loaded Configuration File => /etc/php.ini
-
Once you have located it, open it in your favorite text editor.
nano /path/to/php.ini
-
Add the
zend_extension
line that we found earlier to the top of this file, below the line that reads[PHP]
. -
Restart PHP and Apache.
/etc/init.d/apache2 restart
-
In your web browser, navigate to
http://<yourip>/ioncube/loader-wizard.php
. -
You may see an error about the fact that some functions may be unavailable. I haven’t noticed any issues due to this error message.
-
Enjoy! You can now install your application that needs IonCube loader.
Want to contribute?
You could earn up to $300 by adding new articles
Suggest an update
Request an article