1

In my PHP web application there is this line:

require_once(__DIR__. '/myfiles.phar');

I'm using this to include a self-created PHAR file with ≈8 MB file size.

One customer has a memory_limit setting of 16M.

In this environment, I do receive an error

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 16777216 bytes) in /var/www/my.php on line 3

(See also e.g. here)

Since the customer cannot increase the memory_limit setting value, I'm clueless on how to adjust this.

My question:

Is there any way to tell the PHAR functions in PHP to use less memory when "extracting" PHAR files?

(I'm guessing the the size of my PHAR file is directly linked to the memory usage. So the obvious but complicated way would be to reduce the size of the PHAR file).

Community
  • 1
  • 1
Uwe Keim
  • 36,867
  • 50
  • 163
  • 268

0 Answers0