ToonMariner Posted July 10, 2007 Share Posted July 10, 2007 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. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted July 10, 2007 Author Share Posted July 10, 2007 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... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.