FRIHOST • FORUMS • SEARCH • FAQ • TOS • BLOGS • COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


" Fatal error: Allowed memory size of 52428800" bl





maeglin20
Quote:
Fatal error: Allowed memory size of 52428800 bytes exhausted (tried to allocate 35 bytes) in /usr/home/maeglin2/domains/maeglin.frih.net/public_html/tema/functions/functions.php on line 262


It is my functions.php:

Quote:
258 if($i == 0) {
259 $brk .= '<li class="list_first"><a href="'.$link_dizi[$i].'">'.$name_dizi[$i].'</a></li>';
260 } else {
261 if(!$logged['id']) {
262 if((!$name_dizi[$i] = "Durum") || (!$name_dizi[$i] = "Atış Antremanı") || (!$name_dizi[$i] = "Sürüş Antremanı") || (!$name_dizi[$i] = "Operasyon")) {
263 $brk .= '<li><a href="'.$link_dizi[$i].'">'.$name_dizi[$i].'</a></li>';
264 }
265 } else {
266 $brk .= '<li><a href="'.$link_dizi[$i].'">'.$name_dizi[$i].'</a></li>';
267 }
268 }


How can I fix it ?
flatliner
From my quick look over your code there isn't anything that would exhaust the memory.
Maybe it has something to do with your Sql calls?
Also your code is a bit messy, yea probably do a better job if you use a switch statement like the one below.

Good luck in solving your problem

Code:


switch ($i) {
 
   case "apple":
        echo "i is apple";
        break;

    case "bar":
        echo "i is bar";
        break;

    case "cake":
        echo "i is cake";
        break;
}


Bondings
It seems like your script is taking too much memory and reached the limit on that line. It could very well be that the memory problem is before that line. If you made a lot of modifications to the software, maybe that can be the cause of it?
imagefree
something is wrong before line # 262.
You have alocated a total memory of 50Mb in your php.ini file and almost all the memory is used before the line 262.

Possible Reasons:

You might have tried any image modification/thumbnail creation (imagecreatetruecolor() or similar functions sometime cause this problem).

Script queries the database and selects a huge amount of data,

script includes / opens a large number of files,

or similar reason.

Solution:

If you have access to php.ini file, search for this,
Code:
memory_limit

and add in front of it the desired amount of memory (64MB or 100MB etc)

If you dont have access to php.ini file, add the following to .htaccess
Code:
php_value memory_limit 100M


or a third solution may be, use this code at the top of your php script on which the problem occurs.
Code:
ini_set('memory_limit', '64M');

try and reply.
maeglin20
Never more. I've fixed it. Thx for everything Smile But now, I have got a problem, too. I've registered to my script, and i've created a character with character creator form. And I've changed some codes, now I can register but, I can't login to system. The 1st Account haven't got any problem. Problem is about new accounts. Anybody can help me ?
Related topics
Fatal PHP error
www.poxyproxy.com is BACK!!!- Access blocked sites@school
Fatal error: Allowed memory size of 8388608 bytes exhausted
MySQL backup, cant find where to load them
fatal error
gallery2
Trying to restore my discussion board.
increase php memory size please
PHP - Solve PHP Fatal error: Allowed memory size of 8388608
after installing drupal memory error
after installing drupal memory error
Ca't retreive email via webmail (Fatal error:Allowed memory)
PHP'de bir sorunum var..
Fatal error Allowed memory size of 268435456 bytes exhausted
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.