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.
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,
Navigate to domain’s public_html directory.
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.
sudo wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz sudo tar xvfz ioncube_loaders_lin_x86.tar.gz
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.
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.
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.
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,
Open PHP CLI configuration file and append the content from the file you downloaded earlier.
Save and exit. then reboot the server.
Once server comes back online, open following url in the browser,
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