DropVPS Team
Writer: Cooper Reagan
How to Install IonCube Loader in DirectAdmin

Table of Contents
IonCube Loader allows encoded PHP applications to run securely on your DirectAdmin server. Here’s a straightforward setup that works on CentOS, AlmaLinux, or Rocky 9 servers running DirectAdmin.
Step 1: Connect to the Server via SSH
Log in as root or a sudo-enabled user:
ssh root@your-server-ip
Step 2: Update Your System
Before doing anything else, make sure your system packages are current:
dnf update -y
Step 3: Check Your PHP Version
DirectAdmin usually installs multiple PHP versions. To find the one you’re using:
php -v
Or check available versions via CustomBuild:
cd /usr/local/directadmin/custombuild
./build versions
Step 4: Download IonCube Loader
Move to the temporary directory and grab the latest IonCube package:
cd /usr/local
wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar xvf ioncube_loaders_lin_x86-64.tar.gz
Step 5: Locate PHP Extension Directory
Check the PHP extension directory path for your current version:
php -i | grep extension_dir
It usually looks like:
/usr/local/php81/lib/php/extensions/no-debug-non-zts-20220829
Step 6: Copy the IonCube Loader File
Copy the correct IonCube file for your PHP version into the extension directory:
cp ioncube/ioncube_loader_lin_8.1.so /usr/local/php81/lib/php/extensions/no-debug-non-zts-20220829/
(Adjust for your PHP version.)
Step 7: Enable IonCube Loader in PHP Configuration
Edit or create a new .ini file inside your PHP configuration folder.
Example for PHP 8.1:
nano /usr/local/php81/lib/php.conf.d/00-ioncube.ini
Add this line:
zend_extension = /usr/local/php81/lib/php/extensions/no-debug-non-zts-20220829/ioncube_loader_lin_8.1.so
Save and exit (Ctrl + O, Ctrl + X).
Step 8: Restart Services
Restart PHP and Apache (or Litespeed/OpenLiteSpeed, depending on your DirectAdmin setup):
service httpd restart
or :
systemctl restart php-fpm81
(Change the service name based on your active PHP version.)
Step 9: Verify Installation
Check if IonCube is active:
php -v
You should see a line like:
with the ionCube PHP Loader (enabled)
Optional Step: Enable IonCube for All PHP Versions
If you’re using multiple PHP versions via CustomBuild:
cd /usr/local/directadmin/custombuild
./build set ioncube yes
./build ioncube
./build php n
This ensures IonCube Loader is installed globally across all versions.
After upgrading PHP through DirectAdmin, rerun the IonCube setup or rebuild PHP to keep compatibility with your new PHP version.