Gateway Timeout / File Upload: 500 Internal Server Error
Issue
File upload failures may result in the following errors:
- Gateway Timeout
- 500 Internal Server Error
- Batch file upload failed Internal Server Error
- Allowed memory size exhausted
- Single Step Form: "The pictures.X failed to upload"
Solution
In addition to file size constraints, memory limitations require attention. Modify these php.ini variables:
max_execution_time = 120 memory_limit = 512M post_max_size = 128M upload_max_filesize = 64M max_input_time = 240
This configuration example permits uploading files up to 17MB.
Advanced Solutions
Nginx Settings
Configure the client_max_body_size setting in nginx.conf. The default value of 1m restricts POST requests to 1MB maximum. Increase this to 20m or higher for larger uploads.
Apache Settings
For Apache servers, the LimitRequestBody setting controls request size limits. Unlike Nginx, Apache applies no default restrictions, though configuring this value may be necessary in certain situations.