gnanesh
gnanesh

Reputation: 101

Image upload error in php while using the function imagecreatefromjpeg()

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

Upvotes: 1

Views: 771

Answers (1)

karim79
karim79

Reputation: 342635

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

Upvotes: 2

Related Questions