You are here: Home / Debian GNU/Linux / Servers / PHP / Install IonCube Loader on Debian

Install IonCube Loader on Debian

by Pierre-Yves Landuré last modified Mar 02, 2018 08:35

IonCube Loader is a PHP Zend extension allowing to use licensed PHP files protected with this technology. This post ease its install on Debian.

This how-to is tested on:

  • Debian 6.0 Squeeze
  • Debian 7.0 Wheezy


This how-to needs :


Detect the name of the extension configuration file:

test -d '/etc/php5/mods-available' \
  && MOD_CONF_PATH='/etc/php5/mods-available/ioncubeloader.ini'

Detect the system architecture:

ARCH="$(command dpkg --print-architecture)"
if [ "${ARCH}" = "i386" ]; then
elif [ "${ARCH}" = "amd64" ]; then

Detect the PHP version:

PHP_VERSION="$(command php --version 2>'/dev/null' \
    | command head -n 1 \
    | command cut --characters=5-7)"

Environment preparation

Install the PHP command line:

command apt-get install php5-cli

Software installation

Download the software:

command wget "${ARCH}.tar.gz" \

Extract the downloaded archive:

command tar --directory "/usr/local/" -xzf "/tmp/ioncube_loaders_lin_${ARCH}.tar.gz"

Add the extension to the PHP configuration:

if [ -e "/usr/local/ioncube/ioncube_loader_lin_${PHP_VERSION}.so" ]; then
echo "; configuration for php IonCube Loader module
; priority=05
zend_extension=/usr/local/ioncube/ioncube_loader_lin_${PHP_VERSION}.so" > "${MOD_CONF_PATH}"
test -n "$(command -v php5enmod)" && command php5enmod 'ioncubeloader/05'

Reload the configuration :

test -e '/etc/init.d/php5-fpm' && command service 'php5-fpm' 'restart'
test -e '/etc/init.d/apache2' && command service 'apache2' 'force-reload'