Overview
Large media and imports fail when PHP upload_max_filesize or post_max_size are too low. WordPress also checks multisite network upload space.
All three limits must align: PHP, web server, and WordPress filters.
Implementation
In php.ini set upload_max_filesize = 64M and post_max_size = 64M (post must be >= upload). Add to .htaccess on Apache: php_value upload_max_filesize 64M. Filter: upload_size_limit in functions.php.
Restart PHP-FPM after ini changes. Check Media > Add New for the effective limit.
When implementing guidance from Increase the Maximum File Upload Size in WordPress, start in a controlled environment that mirrors production versions of operating systems, runtimes, and network policies. Capture a baseline before changes: export configs, snapshot VMs, or tag releases in source control so rollback stays straightforward if behavior regresses.
Document prerequisites, expected outcomes, and verification steps in a short runbook. Automated checks—smoke tests, health endpoints, or query validations—catch regressions early when platforms receive patches. Security belongs in every workflow: apply least privilege, rotate secrets, and review audit logs after deployment.
If results differ across machines, compare environment variables, permission models, time zones, and regional settings. Intermittent issues often trace to caching layers, stale DNS, or duplicated services bound to the same port.
Example
@ini_set('upload_max_filesize', '64M');
@ini_set('post_max_size', '64M');
add_filter('upload_size_limit', fn() => 64 * 1024 * 1024);
Tips
- Nginx client_max_body_size must match.
- Huge uploads belong on S3 with plugins.
- Scan uploads for malware.
- Shared hosts may cap regardless of ini.
- Re-verify after reboots, certificate renewals, or failover exercises.
- Align monitoring and alerts with the failure modes described in this guide.
- Keep vendor documentation links handy for breaking changes between versions.
- Pair automation with a manual spot check during initial production rollout.