Install Ioncube Loader inside WordOps

Harshana Serasinghe
3 min readAug 29, 2022
Image Credits — Pch.vector — Freepik.com

WordOps is one of the best tools that allows users to set up websites based on PHP, WordPress, MySQL, and many more. With a few commands, you can set up a fully functional website with an SSL certificate configured. In this tutorial, let’s talk about installing the Ioncube Loader PHP extension inside a WordOps VPS.

What is Ioncube Loader?

Ioncube Loader is a PHP extension which helps you to protect your PHP scripts with Licensing and Encryption. It currently supports PHP 7.x versions and PHP 8.1

Prerequisites

Check PHP Version

PHP 7.x or 8.1 stack should be installed in your WordOps Installation. At the moment of writing this article, the PHP 8.0 version is not yet supported by Ioncube Loader.

To check the current version of the installed and enabled PHP stack, use the below command:

wo site info example.com

Replace example.com with your site name and Press Enter. This will show the currently installed and enabled PHP Version.

Install / Update to a supported PHP version

If your installation does not have a supported PHP version, you can install a supported PHP Version by one of the following commands:

  1. PHP 7.2
wo site update example.com --php72

2. PHP 7.3

wo site update example.com --php73

3. PHP 8.1

wo site update example.com --php81

Download the relevant Ioncube Loader

Check Processor Architecture

There are two main factors that need to be checked prior to downloading the relevant package.

  1. Operating System — This can be found in your VPS provider’s control panel
  2. Processor Architecture — To check the relevant architecture, use the following command:
lscpu

You will see some details about your server. At the very top, there is a column called “Architecture” with a value.

If the value is x86 , i686 or i386 , that means you are running a 32-bit kernel.

If the value is x86_64 , amd64 or x64 , that means you’re running a 64-bit kernel.

Visit the website and Get the relevant Link

After figuring out the two values, you can visit https://www.ioncube.com/loaders.php and find the relevant package.

Example: If you’re running on a Linux 64 Bit environment, then your package name will be something like the below:

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

Then paste the link inside your Server terminal like below:

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

This will download the relevant package. You can use any folder to download this file. For this tutorial, I created a new directory called ioncubeinside usr/local directory and downloaded the package into that directory.

Unzipping the Ioncube Loader package

The package comes as tar.gz file. To unzip the package, use the following command:

tar xzf ioncube_loaders_lin_x86-64.tar.gz 

To remove the tar.gz file, use the following command:

rm -f ioncube_loaders_lin_x86-64.tar.gz

then if you navigate to the unzipped directory, you will see a set of files for each and every supported PHP Version.

Installing the Ioncube Loader

Before installing the Ioncube loader, you need to find the relevant file that you need to install. When you navigate to the unzipped directory, you will see a set of files. They’re named with the PHP Version you use. As an example, if you use the 8.1 version, then the file name will something like the below:

ioncube_loader_lin_8.1.so

After identifying the relevant file, you can copy the path and add it to the PHP.ini file.

Your PHP.ini files are located in these two directories:

  1. /etc/php/<version>/cli (Example: /etc/php/8.1/cli)
  2. /etc/php/<version>/fpm (Example: /etc/php/8.1/fpm)

Open up those two files one by one and add the following line at the very bottom of the file:

zend_extension = "/usr/local/ioncube/ioncube_loader_lin_8.1.so"

The usr/local/ioncube/ is the path where the files are downloaded and unzipped. You can move them to somewhere else or use the relevant as needed.

After adding the above line to both files, you can reload the WordOps stack by using the following command:

wo stack reload

Verifying the Installation

After installing and reloading the stack, you can use the PHP Version command — php -v to check whether the Ioncube Loader is correctly installed. If it is correctly installed, you will see the output as below:

PHP 8.1.9 (cli) (built: Aug 15 2022 09:39:52) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.9, Copyright (c) Zend Technologies
with the ionCube PHP Loader v12.0.1, Copyright (c) 2002-2022, by ionCube Ltd.
with Zend OPcache v8.1.9, Copyright (c), by Zend Technologies
ubuntu@ip-172-26-0-188:/etc/php/7.2/fpm$

And That’s it! You have successfully installed IonCube Loader inside your WordOps site.

--

--

Harshana Serasinghe

In love with tech ever since I got to know what a computer is :)