How to Install ionCube Loaders for Virtualmin LEMP Server

Some php developers protect their code with ionCube encoder. These are usually paid software. And when you want to install these software on your server, you have to install ionCube Loaders to decode them. Or else software doesn’t work. This post will show you how to install ionCube loaders for Virtualmin LEMP server.

Although I have installed ionCube Loaders on Nginx servers before, Virtualmin made things little more complicated. My previous tutorial about ionCube Loaders on Nginx won’t work for Virtualmin-Nginx servers because Virtualmin has its own way of handling php and nginx. So I decided to write this tutorial hoping that it might come handy for someone who are looking to install ionCube loaders for Virtualmin LEMP server.

I’m going to assume that you’ve already setup your server by following all steps on my Virtualmin LEMP server setup tutorial and created a virtual server for your domain.

If you’ve already done that, you can install ionCube loaders for Virtualmin LEMP server by following instructions below. If not, please do it before continuing.

Let’s Install ionCube Loaders for Virtualmin LEMP Server

Start by logging in to your server as root. And then change to your domains admin user with command su. Like this,

su AdminUser

Navigate to domain’s public_html directory.

cd /home/AdminUser/public_html

Change ‘AdminUser’ with your domain’s administrative username in the above command. And then run following commands to download and extract ionCube Loaders install Wizard script. Make sure you run the appropriate command for your system architecture.

32bit Systems
sudo wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
sudo tar xvfz ioncube_loaders_lin_x86.tar.gz
64bit Systems
sudo wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
sudo tar xvfz ioncube_loaders_lin_x86-64.tar.gz

Run ionCube Loader Install Wizard

Now point your browser to following url. Replace example.com with your domain name. Your domain DNS should be configured to point to your server’s IP address at this point. Otherwise you won’t be able to access ionCube install wizard.

http://example.com/ioncube/loader-wizard.php

Wizard will ask the type of your web-server. Check Dedicated or VPS, answer the two questions and click next. You’ll see a webpage with similar instruction like below.

Install ionCube Loaders for Virtualmin LEMP Server

Installer wizard is asking to copy the correct loader for your server to /usr/lib/php/20170718 directory. Make note of the correct loader and path for your server and change the following command accordingly, You should run this command as root.

cp /home/AdminUser/public_html/ioncube/ioncube_loader_lin_7.2.so /usr/lib/php/20170718

Next, we’ll fix that zend_extension error. If you look at the install instructions given by the install wizard, on step 3, it’s asking you to download a file. So save it to your desktop. But instead of uploading it to the server, we’ll append php.ini file with its content. So open php.ini file. Select the command according to php version installed on your server.

PHP 5.6
nano /home/AdminUser/etc/php5.6/php.ini
PHP 7.0
nano /home/AdminUser/etc/php7.0/php.ini
PHP 7.1
nano /home/AdminUser/etc/php7.1/php.ini
PHP 7.2
nano /home/AdminUser/etc/php7.2/php.ini

Now open downloaded file with Notepad and copy-paste its content to the bottom of php.ini file. Save and exit. We need to make sure ionCube loaders are installed for command line as well. Because some applications require cronjobs setup and these cronjobs are executed using PHP CLI. Run following command to find the loaded configuration file for PHP CLI,

php --ini

You’ll see a out put like this,

Open PHP CLI configuration file and append the content from the file you downloaded earlier.

nano /etc/php/7.1/cli/php.ini

Save and exit. then reboot the server.

reboot

Once server comes back online, open following url in the browser,

http://example.com/ioncube/loader-wizard.php?timeout=0&ini=0&page=loader_check

It’ll check to see if ionCube Loader is successfully installed. If it’s successful, you should see Loader Installed Successfully in a green background alone with ionCube version number and your PHP version number. Now you should remove install script to complete the installation. Run following command to do so,

rm -rf /home/AdminUser/public_html/ioncube
rm /home/AdminUser/public_html/ioncube_loaders_lin_x86-64.tar.gz

Tharindu

Hey!! I'm Tharindu. I'm from Sri Lanka. I'm a part time freelancer and this is my blog where I write about everything I think might be useful to readers. If you read a tutorial here and want to hire me, contact me here.

Related Articles

2 Comments

  1. I get 502 Bad Gateway when trying to visit

    http://t.riotrk.com/ioncube/loader-wizard.php

    Checked all steps, tried to reinstall everything from scratch. This happens only for PHP 7.1, when trying to do the same for PHP 5.6 then it loads everything ok.

    Any thoughts?

    Thanks
    Ante

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button