If you’re managing a Plesk or CloudLinux server, you may have encountered the “cannot load the ionCube PHP loader” error:
“Cannot load the ionCube PHP Loader – it was already loaded.”
This typically occurs when ionCube Loader is configured to load more than once — usually from different PHP configuration files. Since ionCube is a Zend extension, PHP cannot load multiple instances at the same time, resulting in this error.
In this guide, we’ll walk through identifying the cause and fixing the cannot load the ionCube PHP loader issue for PHP 8.1 environments running on Plesk or CloudLinux.
Understanding the Issue
PHP loads its extensions from multiple configuration files:
- The main php.ini
- Additional .ini files inside directories like /etc/php.d/ or /opt/alt/php*/etc/php.d.all/
In many cases, ionCube may be automatically loaded by the system (for example, by Plesk or CloudLinux). However, if you manually add another zend_extension line in your main php.ini, PHP will attempt to load it twice — causing the conflict.
Steps to Fix the Error
1. Locate Duplicate ionCube Entries
Run the following command to find all ionCube entries in PHP’s configuration:
#grep -ir ioncube /opt/alt/php81/etc
You may see output similar to:
php.d.all/ioncube_loader.ini:zend_extension=/opt/alt/php81/usr/lib64/php/modules/ioncube_loader.so
php.ini:zend_extension = /opt/plesk/php/8.1/lib64/php/modules/ioncube_loader_lin_8.1.so
This indicates ionCube is being loaded from two different locations — one for CloudLinux’s alt-php and another for Plesk’s PHP.
2. Keep Only One ionCube Loader
You must choose which PHP environment your domain uses:
If using Plesk’s PHP 8.1, comment out the CloudLinux ionCube line:
#vim /opt/alt/php81/etc/php.d.all/ioncube_loader.ini
Then modify it to:
; zend_extension=/opt/alt/php81/usr/lib64/php/modules/ioncube_loader.so
If using CloudLinux alt-php 8.1, comment out the Plesk line in:
#vim /opt/alt/php81/etc/php.ini
Change it to:
; zend_extension = /opt/plesk/php/8.1/lib64/php/modules/ioncube_loader_lin_8.1.so
3. Restart PHP and Web Server
After saving the changes, restart the relevant services:
#systemctl restart plesk-php81-fpm
#systemctl restart apache2
4. Verify ionCube Loader
Finally, check that ionCube is loaded correctly:
#/opt/plesk/php/8.1/bin/php -v
You should see:
PHP 8.1.x (cli)
with the ionCube PHP Loader (enabled)
No warnings about “already loaded” should appear.
Conclusion
The “ionCube PHP Loader already loaded” error is caused by duplicate configuration entries — typically when both Plesk and CloudLinux attempt to load ionCube for the same PHP
version. By identifying and keeping only one valid zend_extension line, you can easily resolve this issue.
Regularly reviewing your PHP configuration helps prevent such conflicts, ensuring your server runs smoothly and efficiently
If you’re still facing the “cannot load the ionCube PHP loader” error or need expert help resolving PHP module issues, our team at Skynats is here to assist. With our Server Management Services and Web Server Optimization Services, we ensure your applications run smoothly and efficiently. Contact us today for quick and reliable server support.