I'm working on a script that resizes uploaded photos. I've got it working on a source JPEG that's 2400 x 2400 px, but it fails on one that's 2500 x 2500 px with the error "Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 10000 bytes) in [name of script]"

What's odd is that I had the hosting company increase PHP's "memory_limit" parameter to 64M - but the error suggests it's only set to 32M.

Is there another parameter I should have them increase? They have also set upload_max_filesize and post_max_size to 64M, but is there another parameter that might resolve this memory problem?

  • Bob

    As per the error message, PHP's memory_limit is set to 32M and not 64M (which is the cause of your error). Do you not have the ability to modify (or supply your own) php.ini?

    bunner bob wrote:

    Is there another parameter I should have them increase?

    Nope.

    bunner bob wrote:

    They have also set upload_max_filesize and post_max_size to 64M

    Irrelevant - see above.

      create a PHP file with just this in and see what the memory limits are actually being reported as:

      <?php
      phpinfo();
      

        Yeah - looks like they didn't increase it, though the site CP says they did. My guess is because it's a subdomain something else is overriding. Thanks for the pointer!

          Write a Reply...