
This article provides a guide for how to fix PHP Warning: Module ‘imagick’ already loaded errors.
🛠️ How to Fix PHP Warning: Module ‘imagick’ already loaded Error
When PHP encounters this warning, it means that the Imagick extension is being loaded more than once in your configuration files. While the warning itself usually won’t break functionality, it clutters logs and may indicate configuration mismanagement.
This guide will walk you through diagnosing and fixing the issue on Linux servers (Ubuntu, Debian, CentOS/AlmaLinux/Rocky), cPanel/WHM environments, and even local setups.
-
✅ Understand the Error
PHP loads extensions from:
php.ini
(the main PHP configuration file),- additional
conf.d/*.ini
files, or - custom per-domain PHP configs (such as in cPanel or PHP-FPM pools).
If Imagick is referenced in more than one place, PHP complains that it’s “already loaded”.
-
🔍 Locate Duplicate References
Run the following command to find all instances where
imagick
is enabled:grep -r "imagick" /etc/php* 2>/dev/null
This will search across all PHP versions/config directories. Common locations include:
/etc/php/8.1/cli/php.ini
/etc/php/8.1/apache2/php.ini
/etc/php/8.1/fpm/php.ini
/etc/php/8.1/mods-available/imagick.ini
/etc/php/8.1/conf.d/20-imagick.ini
In cPanel/WHM servers, check:
/opt/cpanel/ea-php*/root/etc/php.d/imagick.ini
grep -ir imagick /opt/cpanel/ea-php*/root/etc
-
🧹 Remove Duplicate Load Directives
In whichever files you find, look for:
extension=imagick.so
or
zend_extension=imagick.so
Make sure only one instance remains active.
For example:- If
php.ini
hasextension=imagick.so
, and20-imagick.ini
also has it, remove it fromphp.ini
. - Always prefer keeping it inside
conf.d/20-imagick.ini
(this is the standard practice).
- If
-
♻️ Restart PHP Services
After cleaning up duplicates, restart PHP services:
- For Apache + mod_php:
sudo systemctl restart apache2
or
sudo systemctl restart httpd
- For PHP-FPM:
sudo systemctl restart php8.1-fpm
- For cPanel/WHM servers:
/scripts/restartsrv_httpd
-
🧪 Verify Fix
Check PHP configuration:
php -m | grep imagick
Expected output:
imagick
(only once).
Check logs again:
tail -f /var/log/apache2/error.log # or tail -f /usr/local/cpanel/logs/error_log
You should no longer see the warning.
-
⚠️ Special Cases
a) cPanel/WHM
- WHM’s EasyApache may auto-generate
imagick.ini
. If you’ve manually addedextension=imagick.so
inphp.ini
, remove it. - Only use EasyApache to manage PHP extensions.
b) Plesk
- Plesk adds extensions via
conf.d
. Remove manual entries from globalphp.ini
.
c) Custom Compiled PHP
- If you compiled Imagick manually, ensure that your
.ini
entry is inconf.d/
and not hardcoded multiple times.
- WHM’s EasyApache may auto-generate
-
🧾 Summary
- The error happens when Imagick is loaded twice.
- Fix by removing duplicate
extension=imagick.so
lines. - Keep the extension declaration only in the appropriate
.ini
file (conf.d/20-imagick.ini
). - Restart PHP services and confirm with
php -m
.
✅ After this, your PHP environment should be clean, without duplicate load warnings.
Conclusion
You now know how to fix “PHP Warning: Module ‘imagick’ already loaded” errors.
✅ Easy Website Management with cPanel Support
Running a business is hard enough — managing your website shouldn’t be. That’s why we include full cPanel support with every hosting plan:
- ✅ Simple Dashboard – No tech skills needed. Easily manage your website, emails, and more from one place.
- ✅ Quick App Installs – Launch WordPress, shopping carts, or other tools with just one click.
- ✅ Professional Email – Create business email addresses (like you@yourbusiness.com) in minutes.
- ✅ Reliable Backups – Keep your website safe with easy-to-use backup and restore options.
- ✅ Secure & Protected – Manage your site’s security and SSL certificates with built-in tools.
- ✅ Real Help, Anytime – Our expert support team is available 24/7 for anything you need.
💬 What Our Customers Say
“I have had nothing but good experiences with Rad Web Hosting. The staff is there to help you to make sure that you stay online and I haven't had any downtime with my server in the time I have been with Rad Web Hosting and I have had my server for over two years.”
— Janice L., Owner of RJGM
🏆 Trusted by Small Business Owners Nationwide

🚀 Get Started Today
Take the stress out of website management. With cPanel support and expert help just a click away, you can focus on what matters most — growing your business.
Choose Your Plan Now