Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2002
    Location
    PA
    Posts
    93
    Thanks
    0
    Thanked 0 Times in 0 Posts

    allowed memory size # exhausted

    In my php upload script if i upload a file larger than x; then i get this error

    Fatal error: Allowed memory size of 8388608 bytes exhausted at (null):0 (tried to allocate 1600 bytes) in /var/www/html/images/screenshots/addfile.php on line 53

    on line 53 in that file i have this:

    $src_img=ImageCreateFromJPEG("/var/www/html/images/screenshots/".$thisid.".".$extension);

    it works with small files; i dunno if theres a variable in the php.ini that i need to make larger or something related to apache?

    tia

  • #2
    New Coder
    Join Date
    Sep 2002
    Location
    PA
    Posts
    93
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok i found out why; in my php.ini the memory size limit is set at 8 mg

    and after reading here http://www.kirupaforum.com/forums/sh...ad.php?t=55050 i can see why my 300kb files are exceeding the 8 mg memory limit

    but i still havent figured out how to get around it being that i dont think my host will change that value

    my host does support gd2; i dunno if i did something with that if it would take less memory

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The GD libraries, when working on a jpeg have to decompile the compressed data to what is tantamount to a 6bytes per pixel string (the basic .gd file format - which it may then compress to .gd2 if needed).
    As every pixel is stored in phps memory there is an upper limit on the size of files that can be worked with.

    Unfortunately GD cannot as yet process from a designated part of a jpeg image.

    If your host has ImageMagick installed, you could try that - it wouldn't have the issues that GD has as it runs from command line calls. Either that or try some script-fu calls to the-gimp if they have that accessible.
    Ökii - formerly pootergeist
    teckis - take your time and it'll save you time.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •