How to reduce the memory my image modification script in php uses?

I created a script that reduces the size of an image and another to watermark images with PHP. The code runs fine on my testing server, but when I upload it to my web host (UK2) they have a 8MB memory limit. I’m not really sure if I will have to work around this and cut it out of my CMS or whether there is anything that can be done to help?

thanks!

One Response to “How to reduce the memory my image modification script in php uses?”

  • Eric C:

    You can temporarily change the memory limit for a script through the ini_set php function.
    Try, <?php print_r( ini_get_all() ); ?> and find some line relating to memory limit (I can’t remember what it was named as I haven’t used PHP in a long time), then just remove the print_r line and ini_set(‘variable_name’, ‘value’); to raise the limit, e.g. 30M.

Leave a Reply