Skip to content

Instantly share code, notes, and snippets.

@grafikchaos
Last active November 29, 2023 07:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grafikchaos/4f1f21d549a5ecc06c60 to your computer and use it in GitHub Desktop.
Save grafikchaos/4f1f21d549a5ecc06c60 to your computer and use it in GitHub Desktop.
Install IonCube on Linux

Overview

I always forget the steps, but it's pretty simple:

Steps:

  • Download the IonCube Loaders
  • Check your PHP version to find which IonCube loader you should use
  • Check your PHP configuration for the extension_dir
  • Copy the IonCube Loader into the PHP extension directory
  • Tell php.ini to load your extension
  • Restart your web server

Download IonCube Loaders (Linux 64-Bit)

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

Check PHP version

$ php -v

Should output something like this:

augash at p3595792 in ~ 
› php -v
PHP 5.3.3 (cli) (built: Dec  5 2013 07:09:40) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

So if you are using PHP 5.3.x then you should be using the ~/ioncube/ioncube_loader_lin_5.3.so IonCube loader.

Check PHP configuration for extension_dir

You'll need to copy the proper IonCube loader (determined from previous step, e.g., ioncube_loader_lin_5.3.so) into your PHP's extension directory, which you can find with the following command:

$ php -i | grep extension_dir

Which should output something like this:

augash at p3595792 in ~ 
› php -i | grep extension_dir
extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules

Copy the IonCube Loader into the PHP extension directory

Again, using the IonCube loader and extension_dir values determined from previous steps, you can now copy the loader over (you may need to be root user or have sudo privileges to do this).

$ sudo cp ~/ioncube/ioncube_loader_lin_5.3.so /usr/lib64/php/modules

Tell php.ini to load your extension

You can either put the following code in your php.ini file or if your PHP is configured to dynamically load ini files (typically from /etc/php.d/) then you can create an /etc/php.d/ioncube.ini file and put something similar to this in the file:

$ sudo vi /etc/php.d/ioncube.ini

In my /etc/php.d/ioncube.ini file:

zend_extension = /usr/lib64/php/modules/ioncube_loader_lin_5.3.so

Restart your web server

Apache: (Ubuntu/Debian)

$ sudo service apache2 restart

Apache: (RedHat/CentOS)

$ sudo service httpd restart

Nginx with PHP-FPM

Note: some PHP-FPM installations will use php5-fpm instead of php-fpm

$ sudo service nginx restart
$ sudo service php-fpm restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment