Save 50% for your first year of web hosting!

How to Install ionCube PHP Loader on Ubuntu & Debian in NGINX

This tutorial shows you how to actually install the module ionCube PHP loader in Ubuntu & Debian with the NGINX web server. The reason I am writing this tutorial even though there are many other similar ones is because they do not work. They have missed a step 😛

Step 1: Download & Extract ionCube

Alright so lets download ionCube


Then extract it!

tar -xvf ioncube_loaders_lin_x86*

Next you want to enter it:

cd ioncube

Okay so from now on you need to start using your brain a bit :P. First type the command ls to list the files within the directory.


You will see multible similar files but with all of them having a different ending, 5.6, 7.0, 7,3 and so on. These are to your corresponding PHP version. You can check what PHP version you are running by running the following commad

php -v 

So if you are using PHP version 7.3 you want to copy that file. But first we need to find out what extension directory you have. To do this:

php -i | grep extension_dir

Here’s an example output:

extension_dir => /usr/lib/php/20180731 => /usr/lib/php/20180731

/usr/lib/php/20180731 will be different from mine.

Okay so if you are using PHP version 7.3 you need to copy to your extension directory like so:

cp /ioncube/ /usr/lib/php/20180731

Step 2: Add the extension to the php.ini files

Next you want to add this configuration to both of your php.ini configuration files. (don’t forget to replace the extension number with your own)

zend_extension = /usr/lib/php/20180731/

Add the above configuration to he following files. This should be added right below [PHP]

nano /etc/php/7.3/cli/php.ini
nano /etc/php/7.3/fpm/php.ini

That’s it! Now all you need to do is to restart NGINX and PHP:

systemctl restart nginx
systemctl restart php-fpm

You can confirm that it has been installed by running

php -v

It should print out something along these lines:

Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.8, Copyright (c) 1998-2018 Zend Technologies
    with the ionCube PHP Loader + ionCube24 v10.3.8, Copyright (c) 2002-2019, by ionCube Ltd.

We don’t have a donation button, but if this post helped you then please consider switching to us. We offer great VPS solutions as well! Our servers are located in stockholm, so if you’re from Sweden feel free to check out our Swedish site too, and grab yourself a Stockholm VPS.