0

I have got the following error:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate
 34820 bytes) in rotate.php

I did not mange to reproduce it , How can I prevent such things and how can I catch that and return false instead of crash the process.

I can say that I added logger to my code maybe is it related to that error?.

php ini configuration:

memory_limit = 128M

rotation code:

$this->logger->info();
$source = imagecreatefromjpeg($img);
$rotate = imagerotate($source, $rotate_angle, 0);
imagejpeg($rotate,$img);
Scopi
  • 663
  • 1
  • 6
  • 21
  • 1
    Possible duplicate of [Allowed memory size of X bytes exhausted](http://stackoverflow.com/questions/4096582/allowed-memory-size-of-x-bytes-exhausted) – Option Apr 24 '17 at 08:39
  • How big is the image you're trying to rotate; what angle are you rotating by? – Rowland Shaw Apr 24 '17 at 09:06

0 Answers0