Jump to content

Allowed memory size of 8388608 bytes exhausted


ToonMariner

Recommended Posts

I have had this error before - can't remember how I fixed it.

 

I have some kind of memory leakage somewhere.  The scrits in question send an email; run on my local machine no problems what so ever - run on the server and I get the

 

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 11520 bytes) in /home/sites/site.com/public_html/index.php on line 48

 

all this is doing is sending an email...

 

There is a fair bit of code to look through so I'll post it only if someone wants me too.

 

Increasing the memory is not really practicle - the script should never use that much in the first place.

 

I am using ob_start() / ob_end_flush() if that helps

 

Really stuck on this one guys any help would be VERY much appreciated.

 

Hey people. I isolated the portion of code that was causing the problem....

<?php
if	(
file_exists($_SERVER['DOCUMENT_ROOT'] . $_SERVER['REQUEST_URI'])
&&
strcmp($_SERVER['SCRIPT_FILENAME'],	$_SERVER['DOCUMENT_ROOT'] . $_SERVER['REQUEST_URI'])	!=	0
&&
$_SERVER['REQUEST_URI']	!=	"/"
)
{
$url	=	$_SERVER['REQUEST_URI'];
include($_SERVER['DOCUMENT_ROOT'] . $_SERVER['REQUEST_URI']);
exit();
}
?>

 

I am using friendly urls and the index.php page is handling all requests - this snippet is near the top of the page and directs to files that actually exist on the site (like cached files etc).

 

Just wondered if anyone could shed some light on why that code would cause the error..

 

Many thanks...

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.