Install ionCube Loader Manually on a VPS (Step-by-Step Guide)
If you're using a VPS and see the error: "The ionCube PHP Loader needs to be installed." It means your PHP installation is missing ionCube Loader, which is required to run encrypted PHP scripts.
For the panel-based install paths (cPanel/Plesk/DirectAdmin), see Fix: "Site Error: The ionCube PHP Loader Needs to Be Installed". For the SSH-focused but condensed variant, Fix: "Site Error: The ionCube PHP Loader Needs to Be Installed" (VPS/SSH Users). For editing php.ini step-by-step, Edit php.ini to Enable ionCube Loader.
"Site error: The ionCube PHP Loader needs to be installed.
This is a widely used PHP extension for running ionCube protected PHP code, website security and malware blocking."
- SSH access to your VPS (root or sudo privileges)
- Basic command line knowledge
- Web server (Apache, Nginx, or LiteSpeed) installed
- PHP installed on your VPS
Check Your PHP Version
Before installing ionCube, determine your PHP version as ionCube loaders are version-specific.
Step 1: Check PHP Version
php -v
Example Output:
PHP 8.1.10 (cli) (built: Aug 10 2023 19:27:50) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.1.10, Copyright (c) Zend Technologies
Note your PHP version (8.1.10 in this example).
Step 2: Check PHP Architecture
# Check if 32-bit or 64-bit
uname -m
Output should be:
x86_64= 64-bit systemi386ori686= 32-bit system
Step 3: Check Thread Safety
php -i | grep "Thread Safety"
Download ionCube Loader
Step 1: Navigate to Temporary Directory
cd /tmp
Step 2: Download ionCube Loader
For 64-bit systems (most VPS):
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
curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
Step 3: Extract the Archive
tar -xvzf ioncube_loaders_lin_x86-64.tar.gz
cd ioncube
You now have access to all ionCube Loader files for different PHP versions.
Step 4: List Available Loader Files
ls -la *.so
This will show all available ionCube loader files.
Find Your PHP Extensions Directory
Step 1: Find PHP Extension Directory
php -i | grep extension_dir
Example Output:
extension_dir => /usr/lib/php/20210902 => /usr/lib/php/20210902
Step 2: Alternative Method to Find Directory
# Using php-config
php-config --extension-dir
# Using PHP interactive
php -r "echo ini_get('extension_dir');"
Step 3: Common PHP Extension Directories
Ubuntu/Debian PHP 8.1: /usr/lib/php/20210902/
Ubuntu/Debian PHP 8.0: /usr/lib/php/20200930/
Ubuntu/Debian PHP 7.4: /usr/lib/php/20190902/
CentOS/RHEL: /usr/lib64/php/modules/
CentOS PHP 7.4: /usr/lib64/php/7.4/modules/
Custom installations: /usr/local/lib/php/extensions/
Step 4: Verify Directory Exists
ls -la /usr/lib/php/20210902/
You should see other .so files in this directory.
Copy the Correct ionCube Loader File
Step 1: Identify Correct Loader File
Match your PHP version with the correct ionCube loader file:
| PHP Version | ionCube Loader File | Notes |
|---|---|---|
| PHP 8.3 | ioncube_loader_lin_8.3.so | Latest PHP version |
| PHP 8.2 | ioncube_loader_lin_8.2.so | Widely supported |
| PHP 8.1 | ioncube_loader_lin_8.1.so | Most common |
| PHP 8.0 | ioncube_loader_lin_8.0.so | Still supported |
| PHP 7.4 | ioncube_loader_lin_7.4.so | Legacy support |
| PHP 7.3 | ioncube_loader_lin_7.3.so | Older systems |
| PHP 7.2 | ioncube_loader_lin_7.2.so | Deprecated |
| PHP 7.1 | ioncube_loader_lin_7.1.so | Very old |
Step 2: Copy the Loader File
For PHP 8.1 (adjust for your version):
sudo cp ioncube_loader_lin_8.1.so /usr/lib/php/20210902/
Step 3: Set Correct Permissions
sudo chmod 644 /usr/lib/php/20210902/ioncube_loader_lin_8.1.so
Step 4: Verify File Copy
ls -la /usr/lib/php/20210902/ioncube_loader_lin_8.1.so
Expected output shows file permissions and size.
Enable ionCube in php.ini
Step 1: Find php.ini File Location
php --ini | grep "Loaded Configuration File"
Example Output:
Loaded Configuration File: /etc/php/8.1/cli/php.ini
- Apache: /etc/php/8.1/apache2/php.ini
- Nginx with PHP-FPM: /etc/php/8.1/fpm/php.ini
- Also check: /etc/php/8.1/fpm/pool.d/www.conf
Step 2: Find Web Server php.ini
# Find all php.ini files
find /etc -name "php.ini" 2>/dev/null
# Check Apache modules
apache2ctl -M 2>/dev/null | grep php
# Check PHP-FPM status
systemctl list-units | grep php
Step 3: Edit the Correct php.ini
For Apache:
sudo nano /etc/php/8.1/apache2/php.ini
For Nginx with PHP-FPM:
sudo nano /etc/php/8.1/fpm/php.ini
Step 4: Add ionCube Loader Line
Navigate to the "Dynamic Extensions" section (usually around line 900-1000) and add:
zend_extension=/usr/lib/php/20210902/ioncube_loader_lin_8.1.so
zend_extension NOT extension. ionCube is a Zend extension, not a regular PHP extension.
Step 5: Save the File
In nano editor:
- Press Ctrl + X to exit
- Press Y to confirm saving
- Press Enter to keep the same filename
Restart Apache or PHP-FPM
For Apache Web Server:
sudo systemctl restart apache2
# Check status
sudo systemctl status apache2
For Nginx with PHP-FPM:
sudo systemctl restart php8.1-fpm
sudo systemctl restart nginx
# Check PHP-FPM status
sudo systemctl status php8.1-fpm
For Lighttpd:
sudo systemctl restart lighttpd
Check Error Logs
# Apache error log
sudo tail -f /var/log/apache2/error.log
# PHP-FPM error log
sudo tail -f /var/log/php8.1-fpm.log
Verify ionCube Installation
Method 1: Command Line Check
php -m | grep -i ioncube
Expected Output:
ionCube Loader
Method 2: PHP Version Check
php -v
Look for: with the ionCube PHP Loader vX.X
Method 3: Create PHP Info File
- Create a test file:
echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php - Access in browser:
https://yourdomain.com/info.php - Search for "ionCube Loader" using Ctrl+F
- You should see ionCube information
- Remove file after testing:
sudo rm /var/www/html/info.php
Method 4: Test ionCube Function
php -r "echo extension_loaded('ionCube Loader') ? '? ionCube Loaded' : '? ionCube NOT loaded';"
Troubleshooting Common Issues
| Issue | Solution |
|---|---|
| "PHP Fatal error: Unable to load dynamic library" | Check php.ini path. Verify file exists: ls -la /path/to/ioncube_loader_lin_X.X.so |
| Wrong PHP version detected | Check php -v and install correct loader. Match exact PHP version. |
| ionCube Loader is missing | Copy loader file to correct extension_dir. Verify with php -i | grep extension_dir |
| Website still shows ionCube error | Restart Apache/PHP-FPM. Check error logs: sudo tail -f /var/log/apache2/error.log |
| PHP info does not show ionCube | Edit web server's php.ini (apache2/fpm), not cli php.ini. Restart web service. |
| ionCube works in CLI but not browser | Different php.ini files. Edit the one used by your web server. |
| "undefined symbol" error | Loader incompatible. Download correct version from ioncube.com |
| Permission denied | Check file permissions: sudo chmod 644 /path/to/ioncube*.so |
Summary
| Step | Command/Action |
|---|---|
| 1. Check PHP Version | php -v |
| 2. Download ionCube | wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz |
| 3. Extract Archive | tar -xvzf ioncube_loaders_lin_x86-64.tar.gz && cd ioncube |
| 4. Find Extensions Dir | php -i | grep extension_dir |
| 5. Copy Loader File | sudo cp ioncube_loader_lin_X.X.so /path/to/extension_dir/ |
| 6. Edit php.ini | Add zend_extension=/path/to/ioncube_loader_lin_X.X.so |
| 7. Restart Web Server | Apache: sudo systemctl restart apache2Nginx: sudo systemctl restart php-fpm && sudo systemctl restart nginx |
| 8. Verify Installation | php -m | grep ionCube or check phpinfo(); |
| 9. Cleanup | rm -rf /tmp/ioncube* and remove info.php |
Now your ionCube Loader is fully installed and running on your VPS!


