If an account's error_log file is growing rapidly with repeated "module not found" or "undefined function" errors, PHP is trying to use extensions that aren't installed or enabled for the account's PHP version. This floods the log, consumes disk space, and can mask real errors. This guide covers how to identify and silence the noise.
Check what's flooding the log: sort ~/public_html/error_log | uniq -c | sort -rn | head -20. This shows the most frequently repeated error lines, which are almost always the culprit.
01. Identifying the Missing Modules
# See the top repeated errors
sort /home/username/public_html/error_log | uniq -c | sort -rn | head -20
# Common patterns you'll see:
# PHP Warning: Module 'imagick' already loaded in Unknown on line 0
# PHP Fatal error: Uncaught Error: Call to undefined function gd_info()
# PHP Warning: PHP Startup: Unable to load dynamic library 'memcached.so'
There are two distinct issues here. "Module already loaded" means the module is loaded twice (duplicate config lines). "Unable to load" or "undefined function" means the module isn't available at all.
02. Common Causes
PHP version changed - The account switched from PHP 8.1 to 8.2 but the site's code calls functions from extensions that aren't installed for 8.2.
Plugin requires a missing extension - A WordPress plugin requires imagick, gd, intl, or another extension that isn't enabled for the account's PHP version.
Duplicate module loading - The module is loaded in both the system php.ini and the account's local php.ini, causing "already loaded" warnings on every request.
CloudLinux PHP Selector mismatch - Extensions enabled in the CloudLinux PHP Selector don't match what's available for the selected PHP version.
03. Fix: Install the Module
If the site needs the module, install it for the correct PHP version:
# For EasyApache PHP (server-level)
yum install ea-php82-php-gd
yum install ea-php82-php-pecl-imagick
# For CloudLinux alt-PHP (per-account)
selectorctl --install-extension=imagick --version=8.2
# Or enable it for the account via CloudLinux selector
selectorctl --user=username --enable-extension=imagick
04. Fix: Disable the Reference
If the module isn't needed (the site works fine without it and the errors are just noise), remove the reference:
For "Already Loaded" Warnings
Check for duplicate extension loading in the account's local php.ini:
# Check for duplicate extension lines
grep -r "extension=" /home/username/.php/
grep -r "extension=" /home/username/public_html/.user.ini
Remove duplicate lines from the user's local php.ini or .user.ini file.
For "Undefined Function" Errors
The site code is calling a function that requires a module. Either install the module (above) or find and fix the code. Common culprits are plugins that don't check for extension availability before calling functions.
05. Cleaning Up the Log
Once the errors are fixed, clean up the bloated error_log:
# Check the current size
ls -lh /home/username/public_html/error_log
# Truncate it (keeps the file, clears contents)
> /home/username/public_html/error_log
# Or if it's enormous and you want to keep recent entries
tail -1000 /home/username/public_html/error_log > /tmp/error_log_trimmed
mv /tmp/error_log_trimmed /home/username/public_html/error_log
chown username:username /home/username/public_html/error_log
Large error_log files can consume significant disk quota and inodes. On accounts with inode limits, a runaway error_log can actually cause the site to go down when the account hits its inode limit. Monitor error_log sizes as part of regular maintenance.
Persistent Log Flooding?
If the errors keep recurring after installing/disabling the relevant modules, there may be a deeper PHP configuration issue. Open a ticket with the top 5 most frequent error lines.
Open a Support TicketQuick Recap: Fixing Error Log Floods
- Identify the pattern -
sort | uniq -c | sort -rnthe error_log to find the repeated lines - Install or disable - Either install the missing module or remove the reference
- Fix duplicates - Remove duplicate extension lines from user php.ini files
- Truncate the log - Clear the bloated error_log after fixing the cause
- Monitor going forward - Check error_log sizes during routine maintenance
Last updated March 2026 · Browse all Errors articles
