? Error: 413 Request Entity Too Large
Overview
The “413 Request Entity Too Large” error occurs when a client (such as a browser or API client) attempts to upload a file that exceeds the server’s configured size limits. This is commonly encountered during file uploads in WHMCS, such as importing database backups, uploading attachments, or updating modules.
Cause
This error is typically triggered by server-side limitations set in the web server configuration (e.g., NGINX or Apache) or PHP settings that restrict the maximum allowed request size.
Resolution Steps
For NGINX Users
- Edit the NGINX Configuration File
Open your NGINX configuration file, usually located at:/etc/nginx/nginx.conf
Or for site-specific settings:/etc/nginx/sites-available/yourdomain.conf
- Increase the
client_max_body_size
Add or modify the following directive inside thehttp
,server
, orlocation
block:
Adjustclient_max_body_size 20M;
20M
to the desired maximum upload size. - Restart NGINX
sudo systemctl restart nginx
For Apache Users
- Edit the
.htaccess
File
Add the following lines:
php_value upload_max_filesize 20M php_value post_max_size 25M
- Or Edit
php.ini
(if accessible)
Locate and modify:
upload_max_filesize = 20M post_max_size = 25M
- Restart Apache
sudo systemctl restart apache2
For WHM/cPanel Users
- Login to WHM
- Navigate to: Home » Software » MultiPHP INI Editor
- Select your domain and adjust:
upload_max_filesize
post_max_size
- Save changes and restart Apache if necessary.
Test the Fix
After applying the changes, try uploading the file again in WHMCS. If the issue persists, double-check the configuration and ensure the web server has been restarted.
Additional Tips
- Always back up configuration files before making changes.
- Ensure your PHP version supports the configured limits.
- Consider setting slightly higher limits than needed to avoid future issues.
If you continue to experience issues, please contact your hosting provider or server administrator for further assistance.