0

When I upload a file which is less than 500MB on a server using PHP, then it uploads perfectly. But when I try to upload above 500MB (like 550MB or 700MB) then it shows error.

My php.ini settings are below

upload_max_filesize=2048M 
post_max_size=2048M
max_execution_time=3000 (50 minutes)
memory_limit=1024M

I have tried debugging and I found out something

After the file upload I checked the temp path of the file with this function !file_exists($_FILES['fileToUpload']['tmp_name']) and it returned true, and when I uploaded less than 500MB then returned false and file was uploaded successfully.
I'm using amazon web server it's specifications are - 4GB RAM.
- 2 Processors.

I'm not sure where is the problem.

Crouching Kitten
  • 1,135
  • 12
  • 23
  • What error does it show? – Jay Blanchard Jan 03 '17 at 20:43
  • Did you check if your php.ini settings got applied? Just create a PHP file with this content ` – Crouching Kitten Jan 04 '17 at 09:30
  • By the way see the second answer here: http://stackoverflow.com/questions/5053290/large-file-upload-though-html-form-more-than-2-gb HTML5 can slice a big file into parts, and upload them separately. So this problem could be solved by involving the frontend developer. – Crouching Kitten Jan 04 '17 at 09:43
  • Occur this error while uploading above 500MB file UPLOAD_ERR_CANT_WRITE (Failed to write file to disk.) when i use error handling using this parameter of file $_FILES['file_name']['error']. I match the error with php manual php.net/manual/en/features.file-upload.errors.php – Hammayun Raza Jan 05 '17 at 06:12
  • Try to check the available disk space: http://php.net/manual/en/function.disk-free-space.php Or contact the support of amazon. Maybe there's a file size limit. – Crouching Kitten Jan 05 '17 at 16:35

0 Answers0