If you are getting the error: "Site error: The ionCube PHP Loader needs to be installed. This is a widely used PHP extension for running ionCube protected PHP code." It means ionCube Loader is missing or not properly loaded in PHP.
After installing ionCube Loader, you must edit php.ini to enable it. This guide walks you through the process step by step.
1 Understanding the Error
This error occurs when:
- ionCube Loader is not installed on your server
- ionCube is installed but not enabled in php.ini
- Wrong php.ini file is being edited (CLI vs web server)
- Incorrect ionCube version for your PHP version
- Path to ionCube loader file is incorrect
- Installed ionCube Loader on your server
- Located the correct ionCube loader file for your PHP version
- Identified your PHP extension directory
2 Find Your php.ini File
Run the following command to locate the PHP configuration file:
Expected Output:
Web Server php.ini File Locations
CentOS/RHEL: /etc/php.ini or /etc/php.d/ioncube.ini
Plesk: /opt/plesk/php/8.1/etc/php.ini
CentOS/RHEL: /etc/php-fpm.d/php.ini
Also check pool configuration: /etc/php/8.1/fpm/pool.d/www.conf
or check: /opt/cpanel/ea-php81/root/etc/php.ini
Find All php.ini Files
or for a more comprehensive search:
3 Edit php.ini
Once you've identified the correct php.ini file for your web server, open it using nano or another text editor:
Replace 8.1 with your actual PHP version and apache2 with fpm if using Nginx.
Alternative Editors
sudo vim /etc/php/8.1/apache2/php.ini
# Using vi
sudo vi /etc/php/8.1/apache2/php.ini
# Edit and backup
sudo cp /etc/php/8.1/apache2/php.ini /etc/php/8.1/apache2/php.ini.backup
sudo nano /etc/php/8.1/apache2/php.ini
4 Add ionCube Loader to php.ini
Step 1: Find Where to Add the Line
Open php.ini and navigate to the Dynamic Extensions section (usually around line 900-1000). Look for lines starting with extension= or zend_extension=.
You can search within nano by pressing Ctrl + W, then typing extension=.
Step 2: Add the ionCube Loader Line
At the top of the file or in the Dynamic Extensions section, add the following line:
zend_extension NOT extension. ionCube is a Zend extension, not a regular PHP extension.
Step 3: Verify Path and Version
Make sure:
- Path is correct:
/usr/lib/php/20210902/should match your PHP extension directoryphp -i | grep extension_dir - File exists: Verify the ionCube loader file exists
ls -la /usr/lib/php/20210902/ioncube_loader_lin_8.1.so
- Version matches: File name should match your PHP version
php -v
Step 4: Save the File
In nano editor:
- Press Ctrl + X to exit
- Press Y to confirm saving
- Press Enter to keep the same filename
5 Restart Apache or PHP-FPM
For Apache Web Server:
sudo systemctl restart apache2
# CentOS/RHEL 7+
sudo systemctl restart httpd
# Check status
sudo systemctl status apache2
For Nginx with PHP-FPM:
sudo systemctl restart php8.1-fpm
# Restart Nginx
sudo systemctl restart nginx
# Check PHP-FPM status
sudo systemctl status php8.1-fpm
For Lighttpd:
For Plesk:
sudo systemctl restart sw-engine
6 Verify That ionCube Is Loaded
Method 1: Command Line Check
Expected Output:
Method 2: PHP Version Check
Look for the line: with the ionCube PHP Loader vX.X
Method 3: Create PHP Info File
- Create a PHP info file:
echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php
- Access it in browser:
https://yourdomain.com/info.php
- Search for "ionCube Loader" using Ctrl+F
- You should see ionCube information in the output
Method 4: Check via PHP Interactive
Method 5: Remove PHP Info File (Security)
After verification, remove the info.php file:
7 Troubleshooting
| Issue | Solution |
|---|---|
| "Unable to load dynamic library" error | Ensure the zend_extension path is correct in php.ini. Verify file exists and has read permissions. |
| ionCube Loader does not appear in PHP info | Restart Apache/PHP-FPM after changes. Verify you edited the correct php.ini file. |
| Wrong PHP version detected | Check php -v and install the correct ionCube loader version. |
| Website still shows ionCube error | Ensure the ionCube loader file is in the correct extension_dir. |
| ionCube works in CLI but not browser | Edit web server's php.ini (apache2/fpm), not just cli php.ini. |
| Multiple PHP versions installed | Install ionCube for each PHP version and edit corresponding php.ini files. |
| Syntax error in php.ini | Check for typos in the zend_extension line. Ensure no duplicate entries. |
8 Summary
| Task | Command/Action |
|---|---|
| Find php.ini File | php --ini | grep "Loaded Configuration File" |
| Edit php.ini | Add zend_extension=/path/to/ioncube_loader.so(Use correct path for your system) |
| Restart Web Server | Apache: sudo systemctl restart apache2Nginx: sudo systemctl restart php-fpm && sudo systemctl restart nginx |
| Verify Installation | php -m | grep ionCubeor check with phpinfo(); in browser |
| Check PHP Version | php -v |
| Find Extension Directory | php -i | grep extension_dir |
| Test ionCube Loading | php -r "echo extension_loaded('ionCube Loader') ? 'OK' : 'FAIL';" |
Now your ionCube Loader should be fully working and the error should be resolved!


