alexx0186
alexx0186

Reputation: 1557

why does the ini_set('memory_limit') doesn't work?

I am doing a file resizer feature, and when I use very high resolution images, I get this fatal error:

PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to
 allocate 8884 bytes) in /path/resizer.php on line 35

(resizer.php is the resizer class) Then, when I use ini_set('memory_limit', '64MB');

.. in front of the whole block: if (isset($_FILES....)) ... And i get this fatal error:

 PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to 
allocate 8884 bytes) in path/resizerenter code here.php on line 35

Please note that the allocated memory has decreased while I requested an increase. Please let me know if you know what is wrong. Thanks a lot

Upvotes: 4

Views: 4191

Answers (1)

ab_dev86
ab_dev86

Reputation: 1982

check the php.ini setting: memory_limit

Maybe is already more than 64M. In case you can

   ini_set('memory_limit', '128M'); or 256...

Operations with big images can happen to use huge memory!

Upvotes: 3

Related Questions