0

Hi all,

I have been getting ImagickException with imagick on my server but cannot reproduce it on my computer(localhost).

This is when I try to call thumbnailImage(with, height, true) for a JPG

exception 'ImagickException' with message 'Memory allocation failed /tmp/funYYmdPl[0]' @ cache.c/AcquireCacheNexusPixels/416' This is when I call writeImages(path, true) for a GIF exception 'ImagickException' with message 'Memory allocation failed/home/funsub/public_html/uploads/gif/45/45544.gif' @ gif.c/WriteGIFImage/1605'

These are my specs:
ImageMagick 6.5.4-7 2012-05-07 Q16
imagick module version 3.0.1
PHP 5.3.24

I'm on VPS and have set disk usage and bandwidth for that cpanel to unlimited.

I've also tried increasing the php ram usage as well, the problem still occurs.

[root@server ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda3 72G 16G 54G 23% /
tmpfs 427M 0 427M 0% /dev/shm
/dev/vda1 195M 76M 110M 41% /boot
/usr/tmpDSK 622M 50M 541M 9% /tmp

Any ideas why?

3
Contributors
6
Replies
33
Views
4 Years
Discussion Span
Last Post by LastMitch
0

I have been getting ImagickException with imagick on my server but cannot reproduce it on my computer(localhost).

The only thing I can think of is to add a line on the htaccess file and maybe it will read that and you won't get the magickException' with message 'Memory allocation failed.

The line is this

RLimitMem 128000000

You can read more about it here:

http://www.qiq.co.uk/portal/knowledgebase.php?action=displayarticle&id=14

0

Thanks, but it's a memory problem with php, it seems to be imagemagick causing the issue?

0

Thanks, but it's a memory problem with php, it seems to be imagemagick causing the issue?

Do you have log file saying imagemagick cause your issue?

Edited by LastMitch

0

Yeah this:

exception 'ImagickException' with message 'Memory allocation failed `/home/funsub/public_html/uploads/gif/46/46621.gif' @ gif.c/WriteGIFImage/1605' in ...

I know that imagick doesn't use PHP memory. To test that out here's what I did.
I set PHP memory limit to 16M on my develpment server, and 256M on production server. I uploaded the same image, ~500MB. Got the error on the production server but not the development server.
I'm considering possibilities like different versions, or RAM limit, or OS differences. Perhaps Imagick is buggy?

0

I know that imagick doesn't use PHP memory. To test that out here's what I did.
I set PHP memory limit to 16M on my develpment server, and 256M on production server. I uploaded the same image, ~500MB. Got the error on the production server but not the development server.

OK this is the error you got:

exception 'ImagickException' with message 'Memory allocation failed `/home/funsub/public_html/uploads/gif/46/46621.gif' @ gif.c/WriteGIFImage/1605' in.

I don't know what code you are using.

You can read these 2 links which have a similiar situation as you but is solved differently:

http://ubuntuforums.org/showthread.php?t=884679

https://bugs.php.net/bug.php?id=57995

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.