0

I am unzipping large chunked zip file using exec in Laravel PHP. With certain situations, an error occurs in the form of an excessive memory usage: Allowed memory size of 2097152 byte s exhausted

My problem is that I get this message in the system log / artisan console, but not in the PHP. Inside the PHP my code just won't continue executing after the exec line, but it does not cause any error/exception, which prevents me to react informing the user or retrying (or, at least, deleting the now useless chunks).

Is it possible to know inside PHP when this problem is occurring?

elnezah
  • 425
  • 5
  • 17
  • Does this answer your question? [Safely catch a 'Allowed memory size exhausted' error in PHP](https://stackoverflow.com/questions/8440439/safely-catch-a-allowed-memory-size-exhausted-error-in-php) – N69S Apr 12 '22 at 13:06
  • What functions are you using? `ZipArchive::extractTo()` works fine for me. Even if I set the PHP `memory_limit` to be smaller than the zip. – iruoy Apr 12 '22 at 13:23

0 Answers0