1

I'm working on a project where i need to enable users to upload large video files (>1G), I use PHP and MySql (XAMPP) in the server side and Javascript with jQuery in the client side.

I use the Javascript's FileReader with Ajax to upload the video, The problem is that it works only for video files with size of less than 100M, I get this error when trying to upload a file of size > 100M:

"Fatal error: Out of memory (allocated 1065353216) (tried to allocate 325675664 bytes)...".

I updated the following php.ini settings:

memory_limit=20000M
upload_max_filesize=20000M
post_max_size=20000M
max_input_time=3000
max_execution_time=3000

If this is not enough, I also updated the .htaccess file with those settings, restarted XAMPP, and still getting this error for files that are larger than 100M.

Thanks for reading the question so far, Any suggestions?

Daniel Rotnemer
  • 107
  • 3
  • 12
  • 1
    Did you try chunking? https://stackoverflow.com/questions/16102809/how-to-upload-large-files-above-500mb-in-php – delirehberi Sep 16 '20 at 21:29
  • @delirehberi I didn't tried it yet, Is it possible without chunking? – Daniel Rotnemer Sep 16 '20 at 21:40
  • 1
    From the description of [post_max_size](https://www.php.net/manual/en/ini.core.php#ini.post-max-size): _"This setting also affects file upload. To upload large files, this value **must be larger** than [upload_max_filesize](https://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize). Generally speaking, [memory_limit](https://www.php.net/manual/en/ini.core.php#ini.memory-limit) **should be larger** than post_max_size"_. Give it a try. – PajuranCodes Sep 16 '20 at 21:53
  • 1
    Check the remaining physical space on the HDD or SSD - who knows... And what about the "upload_tmp_dir" directive - any known restrictions in regard of the corresponding directory? – PajuranCodes Sep 16 '20 at 22:18
  • 1
    _“I also updated the .htaccess file with those settings, restarted XAMPP, and still getting this error”_ - did you call `phpinfo()` to check if your attempts at changing these values did actually take? – CBroe Sep 17 '20 at 08:30

0 Answers0