Forum Moderators: coopster

Message Too Old, No Replies

php memory limit error

php memory

         

belfasttim

10:03 pm on Apr 21, 2009 (gmt 0)

10+ Year Member



Hi--

I've recently deployed a new server on slicehost, it's running ubuntu server 8.01 in a pretty typical LAMP configuration.

However, I'm getting the old "Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 8653727 bytes)" error-- even though I set the memory_limit to 100M in php.ini (yes, I did remember to restart apache!)

I don't know of anywhere else that this var is set-- any ideas why it's not getting set? Does the whole server need to be kicked over, not just apache?

thanks

belfasttim

10:05 pm on Apr 21, 2009 (gmt 0)

10+ Year Member



more info-- php v is 5.2.4-2, apache is 2.2

thanks!

whoisgregg

10:29 pm on Apr 21, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What are the values reported for memory_limit in the output of phpinfo [php.net]()?

rocknbil

10:32 pm on Apr 21, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



oops, whoisgregg beat me to it. :-)

Did you pull a phpinfo() to make sure it's getting the 100M?

You can also add a per-directory .htaccess directive, no restart required.

More info [webmasterworld.com] which I'm guessing is related to your problem, and if that's close to it IMagick (Imagemagick in PHP) will make it all go away without hogging up system memory.

belfasttim

11:05 pm on Apr 21, 2009 (gmt 0)

10+ Year Member



Hey rocknbil and gregg-- thanks for the input-- yeah, the correct memory is showing up in phpinfo-- and rocknbil you hit it on the head, looks like gd is the culprit. I'll have to rewrite the script to use imagick looks like!

Thanks

belfasttim

1:17 am on Apr 22, 2009 (gmt 0)

10+ Year Member



rocknbil, in case your still hanging about--

you seem to be a pretty frequent customer in the imagick/gd threads-- the script I am updating to use imagick used to use the GD imagejpeg with the "to" parameter null to stream the image to buffer, which I then used to post to amazon S3.

Any idea what the equivalent command in imagick is? I was thinking just writeimage, but it doesn't document it if it is possible to stream it.

thanks

rocknbil

2:35 pm on Apr 22, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So your process is something like upload->manipulate->send to external destination? Sorry I can't help there, I'm pretty familiar with the local write and manipulation of ImageMagick but never tried anything like that. In case you haven't crossed it, the full capabilities of ImageMagick are available at imagemagick.org [imagemagick.org], as long as all the libraries are installed for PHP IMagick.

Maybe you just need to manage your stream as a filehandle and write to it? This page [imagemagick.org] describes writing to STDOUT, but you can write to any filehandle . . .

belfasttim

3:07 pm on Apr 22, 2009 (gmt 0)

10+ Year Member



thanks rocknbil I'll check out those resources