ionCube Loader is a PHP extension used to run encrypted PHP files, commonly required by commercial PHP applications. This article explains how to manually install ionCube Loader on popular Linux distributions such as CentOS, AlmaLinux, Ubuntu, and Debian.

Prerequisites

  • Root or sudo access
  • PHP is installed on the server
  • 64-bit or 32-bit architecture
  • Access to SSH

Step 1: Connect to Your Server via SSH

# ssh root@your_server_ip

Step 2: Verify System Architecture

Check if your server is 64-bit or 32-bit:

  • x86_64 indicates a 64-bit system.
  • i686 or i386 indicates a 32-bit system.

Step 3: Download ionCube Loader

For 64-bit systems:

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

For 32-bit systems:

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

Step 4: Extract the Archive

# tar -xzf ioncube_loaders_lin_*.tar.gz
# cd ioncube

Step 5: Check PHP Version

# php -v
Example:
PHP 8.1.20 (cli) 

Step 6: Locate the PHP Extension Directory

# php -i | grep extension_dir

Typical output:

  • CentOS/AlmaLinux: /usr/lib64/php/modules
  • Ubuntu/Debian: /usr/lib/php/XXXXXX/

Step 7: Copy the Appropriate ionCube Loader

Copy the correct .so file for your PHP version to the extension directory:

# cp ioncube/ioncube_loader_lin_8.1.so /path/to/extension_dir/

Replace 8.1 with your PHP version and use the correct path.

Step 8: Edit the PHP Configuration File

CentOS/AlmaLinux:
# vi /etc/php.ini
Ubuntu/Debian:
# sudo nano /etc/php/8.1/apache2/php.ini  (Apache)
# sudo nano /etc/php/8.1/cli/php.ini      (PHP CLI)
# sudo nano /etc/php/8.1/fpm/php.ini     (PHP-FPM)

Add the following line to the top of the file:

zend_extension = /full/path/to/ioncube_loader_lin_8.1.so

Step 9: Restart the Web Server or the PHP Service

Apache:
# sudo systemctl restart apache2    # Ubuntu/Debian
# sudo systemctl restart httpd        # CentOS/AlmaLinux
PHP-FPM:
# sudo systemctl restart php8.1-fpm

Step 10: Verify ionCube Installation

# php -v

Expected output includes:

With the ionCube PHP Loader (enabled) 

You may also create a PHP info file:

# echo "<?php phpinfo(); ?>" > /var/www/html/info.php

Then visit: http://your-server-ip/info.php in a browser and search for "ionCube".

Was this answer helpful? 2 Users Found This Useful (72 Votes)