+ Reply to Thread
Results 1 to 3 of 3

Thread: PHP Problem

  1. #1
    BeTuned is offline x10Hosting Member BeTuned is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    3

    Lightbulb PHP Problem

    Hi,

    I'm new to x10hosting but not into web development (also, i know CpanelX very well). Anyway, to the point.

    I'm creating a script for an online game to look up stats, the script creates a PNG image (a map) that can be viewed by everyone.

    I tested it on my local server and it worked, but now i uploaded it i'm having a Fatal Error.

    Code:
    Fatal error:  Allowed memory size of 50331648 bytes exhausted (tried to allocate 42 bytes) in (...)
    I know, this is a memory problem and you will think i need to increase my memory limits (request panel etc...), I already did this and i'm now on PHP level 2 (gives me 42 megs of working space).

    The exact point is, the memory the script needed is only maximum 20MB (needs to read 3 files and put them into an image once a day).

    I tested how many memory is needed with the following script line and tested multiple times:
    PHP Code:
    ini_set("memory_limit","20M"); 
    Gives:
    Code:
    Fatal error:  Allowed memory size of 20971520 bytes exhausted (tried to allocate 35 bytes) in
    I increase the memory:
    PHP Code:
    ini_set("memory_limit","32M"); 
    Gives:
    Code:
    Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 45 bytes) in
    What should be the problem? Do i still have not enough memory or is there a serious bug in the script?

    Cheers.

    (I won't post direct links to prevent abuse at the servers, it's a relatively heavy script)

  2. #2
    cowctcat's Avatar
    cowctcat is offline x10 Lieutenant cowctcat is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    In front of a computer
    Posts
    401

    Re: PHP Problem

    I dont think i have ever heard of this happening before. i would make sure that you are freeing up resources you no longer need. Also make sure you didn't accidentaly trap yourself in an infinite loop (i've done this a couple times oops) or a really long loop. Also be carefull not to use too much memory as there is a script in all of the servers that automaticly temporarily suspends your acount for like a couple minutes. Thats about all i got
    --cowctcat

  3. #3
    BeTuned is offline x10Hosting Member BeTuned is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    3

    Re: PHP Problem

    I always try to limit my memory use, but it needs to process several .txt files (normally 3)... i will keep on trying to find the problem. Thanks for the reply.

+ Reply to Thread

Similar Threads

  1. Replies: 3
    Last Post: 03-10-2008, 12:22 PM
  2. problem in php mail function and smtp
    By idrees in forum Free Hosting
    Replies: 2
    Last Post: 02-08-2008, 05:16 PM
  3. Sigo con problemas con phpbb2
    By reciecho in forum Soporte
    Replies: 7
    Last Post: 10-20-2007, 06:28 PM
  4. "PHP Startup: Invalid Library" - Interesting error
    By javaguy78 in forum Free Hosting
    Replies: 5
    Last Post: 03-27-2007, 02:33 PM
  5. php ad code problem
    By sourabhj in forum Free Hosting
    Replies: 7
    Last Post: 08-22-2006, 08:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers