A customer cannot upload a 180 MB video. They contact support, the default upload_max_filesize is 64M, and the temptation is to push it to 512M server-wide. The cost of that change is borne by every other tenant on the box: longer in-flight memory consumption per upload, larger temp files in /tmp, and a wider attack surface for resource-exhaustion abuse. The right answer is to raise the limit on the one account that needs it.
What’s happening
Three directives interact for uploads: upload_max_filesize, post_max_size, and memory_limit. PHP rejects any upload where Content-Length exceeds post_max_size, regardless of upload_max_filesize. post_max_size must be at least as large as the largest expected upload. memory_limit must be larger than post_max_size for the request to have headroom. Apache also has its own ceiling: LimitRequestBody, default 0 (unlimited) but sometimes set in security includes.
How to verify
For the account in question:
whmapi1 php_get_vhost_versions vhost=example.com
cat /var/cpanel/users/<user>/php.ini 2>/dev/null
grep -r "LimitRequestBody" /etc/apache2/
php --ini | head
apachectl -t -D DUMP_INCLUDES | grep -A2 example.com
The first command tells you which PHP version’s ini layer to edit. The grep ensures Apache’s LimitRequestBody is not the actual ceiling.
The fix
- WHM > MultiPHP INI Editor > Basic Mode > pick the user > set:
upload_max_filesize = 256Mpost_max_size = 260M(a bit larger to allow form fields)memory_limit = 512Mmax_execution_time = 300max_input_time = 300Submit.
- Reload the FPM pool for the version:
systemctl reload ea-php82-php-fpm. - If Apache has
LimitRequestBodyset in a server include, edit it via WHM > Apache Configuration > Include Editor > Pre VirtualHost Include (or scope to the user’s vhost). The default of 0 means unlimited; only set a value here if you have a reason. - Confirm
/tmphas the space:df -h /tmp. PHP uploads larger thanupload_tmp_dir’s available space fail with a confusing error. If/tmpis small (mounted tmpfs with 1G), point this account’supload_tmp_dirat/home/<user>/tmpvia the same INI editor. - Test from the customer’s actual upload form. Watch the FPM log for the account:
tail -f /opt/cpanel/ea-php82/root/usr/var/log/php-fpm.log. Watcherror_login the docroot too. - After validation, write the override into your account-overrides notes. The next operator who sees
upload_max_filesize = 256Mshould be able to look up why.
For environments where workload-specific PHP overrides are part of the customer profile, Stack Harbor tracks each override against its workload reason in environment management.