SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Zealot y2kbug's Avatar
    Join Date
    Nov 2004
    Location
    Hong Kong
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    membery exhausted?!

    I've just moved my scripts from one hosting account to another.
    The script works well in the old one, but not the new one.

    http://www.maru-ai.org/thumbnail.php...&fn=r23shi.jpg
    It shows:

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 20400 bytes) in /home/maruiorg/public_html/thumbnail.php on line 7

    Line 7:
    $img = imagecreatefromjpeg($fn);

    I don't understand why 20400 bytes cannot be allocated from 33554432 bytes...
    Please help

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2005
    Posts
    1,191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's not saying 33554432 bytes are all free, that is just the total allowed, other parts of your script will be chewing on it as well. When you call imgcreate there is less than 20400 bytes free.

  3. #3
    SitePoint Zealot y2kbug's Avatar
    Join Date
    Nov 2004
    Location
    Hong Kong
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by hash View Post
    It's not saying 33554432 bytes are all free, that is just the total allowed, other parts of your script will be chewing on it as well. When you call imgcreate there is less than 20400 bytes free.
    Oh... I understand now... Thanks

  4. #4
    SitePoint Zealot y2kbug's Avatar
    Join Date
    Nov 2004
    Location
    Hong Kong
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The problem is solved by adding this line to .htaccess

    php_value memory_limit 192M

    It seems that PHP's error message is not correct (about the numbers)

  5. #5
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Whoa. Are you doing resize on the fly? Wonder, how long this server will stay alive o_O

  6. #6
    SitePoint Zealot y2kbug's Avatar
    Join Date
    Nov 2004
    Location
    Hong Kong
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Shrapnel_N5 View Post
    Whoa. Are you doing resize on the fly? Wonder, how long this server will stay alive o_O
    haha...

    because the source picture is quite big, i am considering that, after creating the thumbnail, the thumbnail will be saved and record the creation in database.


Bookmarks

Posting Permissions

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