Question

I am resizing an image that is uploaded and I am creating a new image after resize using the function imagecreatefromjpeg()

I have been able to successfully resize images of huge dimensions as well.

But when I am try and upload an image having a size above 1.5 MB or so, I get the following error

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 12288 bytes)

The above error comes even if my image size is less than 2 MB

Can anyone tell where am I going wrong here?

I would really appreciate it

Thanks,

Gnanesh

Was it helpful?

Solution

You need to increase the amount of memory available to PHP. Try adding this line into your .htaccess, it fixed the problem for me:

php_value memory_limit 64M
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top