How to Install ionCube Loader on Ubuntu 18.04


Introduction

IonCube Loader is an incredible PHP module extension designed to help programmers encode and encrypt PHP files and increase the speed of web pages.

The application is commonly used with enterprise-class PHP applications to deliver an extra layer of security to secure their source code in the modern era of website crimes.

This tutorial will help you install and configure IonCube Loader on your Ubuntu 18.04 server.

Ready? Let’s get started.

Before You Begin

For this installing to run smoothly, the following must be in place before you begin:

  • A web hosting account that enables you root access to the server or virtual server
  • A user with sudo privileges to run commands as root
  • A fully configured Ubuntu 18.04 server

Step 1 - Installing A Web Server

The first step when installing IonCube Loader on Ubuntu 18.04 is to install a web server (Apache or Nginx). In our case, we’ll install Apache.

 Note: If you have already installed Nginx or Apache skip this step.

To install Apache, run the command below:

$ sudo apt install apache2 php7.2 php7.2-fpm php7.2-cli

Once the installation is complete, issue the commands below to start and enable Apache web server to start during boot time.

$ sudo systemctl start apache2
$ sudo systemctl enable apache2

You can now execute the command below to check the status of your Apache2 web server:

$ sudo systemctl status apache2

This will give you the following output:

● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In:/lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since wed 2018-10-2406:11:24 EDT; 3 weeks 0 days ago
 Main PID:21949 (apache2)
    Tasks:8 (limit:1152)
   CGroup:/system.slice/apache2.service
           ├─993/usr/sbin/apache2 -k start
           ├─995/usr/sbin/apache2 -k start
           ├─996/usr/sbin/apache2 -k start
           ├─997/usr/sbin/apache2 -k start
           ├─998/usr/sbin/apache2 -k start
           ├─2481/usr/sbin/apache2 -k start
           ├─13860/usr/sbin/apache2 -k start
           └─21949/usr/sbin/apache2 -k start

Step 2 - Downloading And Configuring IonCube Loader

Once the web server is installed, you can now download the installation files for IonCube Loader. Before you download these files, run the command below to confirm the version of PHP installed on your system:

$ sudo php -v

This will give you the output below:

PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) (NTS)
Copyright (c) 1997-2018ThePHPGroup
ZendEnginev3.2.0, Copyright (c) 1997-2018ZendTechnologies
       withZendOPcachev7.2.10-0ubuntu0.18.04.1, Copyright (c) 1997-2018ZendTechnologies

From the output, it's clear that the version of PHP installed on your server is 7.2.10.

Now, run the command below to download the required IonCube installation files:

$ sudo wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

Then, issue the commands below to extract the files:

$ sudo tar xvfz ioncube_loaders_lin_x86-64.tar.gz

This will generate a new directory titled ioncube which will feature multiple files for a number of PHP versions. You need to chose the correct folder for your corresponding PHP version (7.2.10).

In this case, you need the file for PHP version 7.2, that is, ioncube_loader_lin_7.2.so. You will need to copy the file to the correct PHP extension directory.  To find the correct PHP extension folder, run the command below:

$ sudo php-config--extension-dir

This will give you the output similar to the one below:

/usr/lib/php/20170718

Now that you know the PHP extension directory, run the command below to copy the file to this directory:

$ sudo cp ioncube/ioncube_loader_lin_7.2.so /usr/lib/php/20170718

For this extension to loaded by PHP, you must add it to the corresponding PHP configuration. There are two ways to do this, one, you can add to the main PHP configuration file; php.ini or else create another file. Here, we’ll load the extension in the main PHP configuration file.

Run the command below:

$ sudo nano /etc/php/7.2/cli/php.ini

Paste the directive below anywhere below the PHP lines.

zend_extension = "/usr/lib/php/20170718/ioncube_loader_lin_7.2.so"

Save the changes and close the nano editor, then restart your Apache service for these changes to take effect:

$ sudo systemctl restart apache2.service

Next, if you are using php-fpm, run the command below to restart it;

$ sudo systemctl restart php7.2-fpm.service

Now, execute the command to check the status of the IonCube Loader:

$ sudo php -v

This will give you the following output:

PHP 7.2.3-1ubuntu1 (cli) (built: Mar 14 2018 22:03:58) ( NTS )
Copyright (c) 1997-2018ThePHPGroup
ZendEnginev3.2.0, Copyright (c) 1998-2018ZendTechnologies
    withtheionCubePHPLoader (enabled) + IntrusionProtectionfromioncube24.com (unconfigured) v10.2.0, Copyright (c) 2002-2018, byionCubeLtd.
    withZendOPcachev7.2.3-1ubuntu1, Copyright (c) 1999-2018, byZendTechnologies

Conclusion

That is it! You have successfully installed and configured the IonCube Loader on your Ubuntu 18.04 server.

Check out these top 3 Linux hosting services

Was this article helpful?