Hata Nedir?
"The uploaded file is too large" hatası web uygulamalarında en sık karşılaşılan upload sorunlarındandır. Kullanıcı bir dosya yüklemeye çalışır, sunucu reddeder. Hata mesajı uygulama tarafından (XenForo, WordPress, WHMCS, Laravel, Django) veya doğrudan web sunucusu (Nginx, Apache, LiteSpeed) tarafından üretilebilir. Sorunun çözümü, yığında yer alan TÜM limit katmanlarını gözden geçirmeyi gerektirir.Katman 1 — Uygulama Limit'i
Her uygulamanın kendi attachment / upload sınırı vardır:XenForo: Admin > Setup > Options > Attachments > "Maximum attachment file size"
WordPress: Media Settings ve wp-config.php
WHMCS: Setup > General Settings > Mail
Laravel: validation rules içinde max:size_in_kb
Bu değer PHP/web sunucu limit'lerinin altında olmalı; aksi takdirde uygulama kullanıcıya yanlış hata mesajı gösterir.
Katman 2 — PHP php.ini Direktifleri
PHP'nin upload davranışını kontrol eden 4 ana direktif:
Code:
upload_max_filesize = 64M
post_max_size = 256M
max_file_uploads = 20
memory_limit = 512M
upload_max_filesize: tek dosyanın maksimum boyutu
post_max_size: POST request'in toplam boyutu (multiple file upload için kritik)
max_file_uploads: tek request'te maksimum dosya sayısı
memory_limit: PHP scriptin kullanabileceği RAM (büyük image processing'de gerekli)
Genel kural: memory_limit ≥ post_max_size ≥ upload_max_filesize
Değişikliği uygulamak için PHP-FPM'i restart edin:
Code:
systemctl restart php-fpm
Katman 3 — Web Sunucu (Nginx)
Nginx kullanıyorsanız client_max_body_size direktifi öne çıkar:
Code:
server {
client_max_body_size 256M;
location / {
...
}
}
Bu değer PHP'nin post_max_size değerinden DAHA YÜKSEK olmalıdır. Nginx PHP'yi çağırmadan önce request'i reddedeceği için tek başına PHP ini ayarı yetmez.
Restart:
Code:
nginx -t # config test
systemctl reload nginx
Katman 4 — Web Sunucu (Apache + LiteSpeed)
Apache'de LimitRequestBody direktifi etkilidir:
Code:
LimitRequestBody 268435456 # 256MB in bytes
.htaccess içinde veya VirtualHost config'inde tanımlanabilir.
LiteSpeed Web Server'da MaxReqBodySize ve MaxDynRespSize direktifleri ayarlanır:
Code:
server {
MaxReqBodySize 256M
}
LSWS admin paneli (port 7080) üzerinden de değiştirilebilir.
Katman 5 — CloudLinux LVE / cPanel
Shared hosting ortamlarında CloudLinux LVE (Lightweight Virtual Environment) per-user memory ve I/O sınırları koyar. Çok büyük upload'lar LVE limit'ine takılabilir.cPanel'de Multi PHP INI Editor kullanıcılara kendi PHP ayarlarını değiştirme imkanı verir; üstündeki LVE limit'leri admin tarafından yönetilir. AIOR Hosting paketlerimizde paket sınıfına göre LVE limit'leri optimize edilmiştir.
Katman 6 — Reverse Proxy ve CDN
Cloudflare, AWS CloudFront, Akamai gibi CDN'ler kendi upload limit'lerine sahiptir. Cloudflare free plan'da maksimum 100MB upload izni varken Pro 500MB'a çıkar. Enterprise plan'da bu artırılabilir.CDN tarafındaki limit aşıldığında 413 hatası alırsınız ve hata sayfası CDN'in kendi sayfasıdır — uygulama görmez.
Hangi Limit'e Takıldınız?
Doğru tanımlama için error log'ları inceleyin:
Code:
# Nginx
tail -f /var/log/nginx/error.log | grep "client intended to send too large body"
# PHP-FPM
tail -f /var/log/php-fpm/error.log
# Apache
tail -f /var/log/httpd/error_log
Hangi katmanın hatayı verdiğini görürseniz nereyi artıracağınızı bilirsiniz.
Pratik Yaklaşım
Çoğu use-case için makul ayarlar:
Code:
Application (XenForo): 50M
PHP upload_max_filesize: 64M
PHP post_max_size: 256M (multiple upload için marj)
PHP memory_limit: 512M
Nginx client_max_body_size: 256M
LSWS MaxReqBodySize: 256M
Çok büyük upload'lar (1GB+) için web upload yerine SFTP veya rsync düşünün. Browser tabanlı upload large file için chunked upload protokolü gerekir (Tus.io, Resumable.js).
AIOR Hosting'de Limit Yönetimi
AIOR Hosting paketlerinde upload limit'leri paket sınıfına göre önceden optimize edilmiştir. Müşterilerimiz cPanel > Multi PHP INI Editor üzerinden PHP limit'lerini kendi yönetebilir. Çok özel ihtiyaçlar için (örn. büyük video yükleme platformu) VPS/dedicated paketlerimizde özel yapılandırma sağlıyoruz.What the Error Means
"The uploaded file is too large" is one of the most common upload errors on web apps. The user tries to upload a file, the server refuses. The message can come from the application (XenForo, WordPress, WHMCS, Laravel, Django) or directly from the web server (Nginx, Apache, LiteSpeed). To fix it you need to review EVERY limit layer in the stack.Layer 1 — Application Limit
Each application has its own attachment / upload limit:XenForo: Admin > Setup > Options > Attachments > "Maximum attachment file size"
WordPress: Media Settings and wp-config.php
WHMCS: Setup > General Settings > Mail
Laravel: max:size_in_kb in validation rules
This value must stay below the PHP/web-server limits, otherwise the app shows the wrong error message.
Layer 2 — PHP php.ini Directives
Four key PHP directives control upload behaviour:
Code:
upload_max_filesize = 64M
post_max_size = 256M
max_file_uploads = 20
memory_limit = 512M
upload_max_filesize: max size per file
post_max_size: total POST body size (critical for multi-file uploads)
max_file_uploads: max files per request
memory_limit: RAM the PHP script can use (needed for image processing)
Rule of thumb: memory_limit ≥ post_max_size ≥ upload_max_filesize
Apply changes by restarting PHP-FPM:
Code:
systemctl restart php-fpm
Layer 3 — Web Server (Nginx)
On Nginx, the client_max_body_size directive matters:
Code:
server {
client_max_body_size 256M;
location / {
...
}
}
This must be HIGHER than PHP's post_max_size. Nginx rejects the request before reaching PHP, so PHP ini settings alone aren't enough.
Restart:
Code:
nginx -t # config test
systemctl reload nginx
Layer 4 — Web Server (Apache + LiteSpeed)
On Apache the LimitRequestBody directive takes effect:
Code:
LimitRequestBody 268435456 # 256MB in bytes
It can be set in .htaccess or the VirtualHost config.
On LiteSpeed Web Server, MaxReqBodySize and MaxDynRespSize are configured:
Code:
server {
MaxReqBodySize 256M
}
Or via the LSWS admin panel (port 7080).
Layer 5 — CloudLinux LVE / cPanel
In shared hosting environments CloudLinux LVE (Lightweight Virtual Environment) enforces per-user memory and I/O caps. Very large uploads may hit the LVE limit.cPanel's Multi PHP INI Editor lets users edit their PHP settings; the LVE caps above them are admin-managed. AIOR Hosting tiers come with LVE limits tuned per plan.
Layer 6 — Reverse Proxy and CDN
CDNs like Cloudflare, AWS CloudFront and Akamai impose their own upload caps. Cloudflare's free plan allows up to 100MB; Pro raises that to 500MB; Enterprise can raise it further.When the CDN-level cap is exceeded, you get a 413 error and the error page is the CDN's — not the application's.
Which Limit Did You Hit?
For precise diagnosis, watch the error logs:
Code:
# Nginx
tail -f /var/log/nginx/error.log | grep "client intended to send too large body"
# PHP-FPM
tail -f /var/log/php-fpm/error.log
# Apache
tail -f /var/log/httpd/error_log
Identifying which layer raised the error tells you exactly where to raise the cap.
Practical Settings
Reasonable settings for most use cases:
Code:
Application (XenForo): 50M
PHP upload_max_filesize: 64M
PHP post_max_size: 256M (margin for multi-file)
PHP memory_limit: 512M
Nginx client_max_body_size: 256M
LSWS MaxReqBodySize: 256M
For very large uploads (1GB+), consider SFTP or rsync instead of web upload. Browser-based uploads of large files need a chunked upload protocol (Tus.io, Resumable.js).