Results 1 to 4 of 4

Thread: PHP Fatal error: Allowed memory size...

  1. #1
    rousseau is offline Sugar Community Member
    Join Date
    Oct 2007
    Posts
    22

    Default PHP Fatal error: Allowed memory size...

    I run Sugar 4.5.1f CE
    Apache 2.052
    CentOS 4.2 on a VPS
    PHP 5.2.5

    It seemed to happen out of the blue, but my web-based SugarCRM installation along with other important web-programs (our company's online shopping cart) is now "Nothing"! It cannot be pulled up at all. The whole server seems to have just stopped, even though I've restarted Apache. My web-host tech support has helped me pinpoint the error:

    HTML Code:
    [error] PHP Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 311296 bytes) in /home/webadmin/(mysite).com/html/vortex/index.php on line 612 
    It appears to be a script problem in PHP which is hogging memory, which would be in this section of code:

    HTML Code:
    // set user, theme and language cookies so that login screen defaults to last values
    if(isset($_SESSION['authenticated_user_id'])) 
    {
    	$GLOBALS['log']->debug("setting cookie ck_login_id_20 to ".$_SESSION['authenticated_user_id']);
    	setcookie('ck_login_id_20', $_SESSION['authenticated_user_id'], time() + 86400 * 90);
    }
    if(isset($_SESSION['authenticated_user_theme'])) 
    {
    	$GLOBALS['log']->debug("setting cookie ck_login_theme_20 to ".$_SESSION['authenticated_user_theme']);
    	setcookie('ck_login_theme_20', $_SESSION['authenticated_user_theme'], time() + 86400 * 90);
    }
    if(isset($_SESSION['authenticated_user_language'])) 
    {
    	$GLOBALS['log']->debug("setting cookie ck_login_language_20 to ".$_SESSION['authenticated_user_language']);
    	setcookie('ck_login_language_20', $_SESSION['authenticated_user_language'], time() + 86400 * 90);
    }

    My question is: I have had the memory_limit in the PHP.INI file set at 60MB when this happened, I have since tried upping it to 300 and restarted Apache and nothing changes. I even tried removing the index file temporarily in order to see if this would allow the web-commerce application to run properly, but it didn't help. My php settings can be found here:

    http://(mysite).com/phpinfo.php

    I have already looked at the other posts on this topic and none seem to have a resolution that I could find, short of rebuilding the server, which I have limited access to.

    Please let me know if anyone knows how to fix this. Thanks in advance for any tips, and guidance on this,

    John
    Last edited by rousseau; 2008-03-17 at 10:56 PM.

  2. #2
    kbrill's Avatar
    kbrill is offline SugarCRM PS Engineer
    Join Date
    Jul 2004
    Location
    St Louis, MO
    Posts
    3,183

    Default Re: PHP Fatal error: Allowed memory size...

    PHP Code:
    /home/webadmin/shop.hotwiredirect.com/html/vortex/index.php 
    Is that the path to your SugarCRMs index.php file. That sections of code that you point to is just creating some cookies. No memory used there at all. Your PHPinfo file looks perfect so I am not sure where else to look. Something somewhere has been currupted and a controlled rebuild may be your only recourse.
    Kenneth Brill - Help Forum Moderator

    I do not respond to 'Private Messages'. Please email me directly instead

    When asking for help, PLEASE give us your Server Information and Version Numbers as asked for on the 'Post New Message' screen as well as any JavaScript errors shown at the bottom of the browser window.
    Help us Help You

  3. #3
    rousseau is offline Sugar Community Member
    Join Date
    Oct 2007
    Posts
    22

    Default Re: PHP Fatal error: Allowed memory size...

    Thanks for the reply and for looking at my php settings,

    To answer your question, that was the location of the file as it sits internally on my server.

    I didn't see anything there that jumped out at me regarding a memory issue, either.

    As far as the controlled rebuild, is there any documentation on this process with this version-4.5.1f? I don't have any other good options at this point, so I wouldn't mind trying it. Do you know what steps are recommended and can protect my data (5,000 or so records) during the process.

    I also have Ajexa email campaigns installed and a couple other added modules (time and invoice, power prospecting, etc.) for what it's worth.

    Thanks again for your help,
    John
    Last edited by rousseau; 2008-03-17 at 10:56 PM.

  4. #4
    rousseau is offline Sugar Community Member
    Join Date
    Oct 2007
    Posts
    22

    Default Re: PHP Fatal error: Allowed memory size...

    Okay, the problem has been fixed, thanks everyone for your constructive input. I'm glad there's such a great community with this software, as our organization is just getting started using SugarCRM.

    Here's what the solution was:

    All the searches for this "[error] PHP Fatal error: Allowed memory size of..." error kept pointing to the PHP.INI file. In fact is was this file, and not the line 612 on the index.php file. But it was not obvious. In the PHP.INI file when the problem arose, I had memory as 60MB, somehow the "B" was not liked by the system and it accepted if for a while, but caused a bug with an error message eventually. After talking more to my web host who is quite attentive, he deleted the "memory_limit" line from the PHP.INI file which solved the problem. So then we re-added it without the "B" and it is working now.

    I hope this could be of use for someone else in the future, and again thanks to those in the community for your responses.

    John

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 19
    Last Post: 2008-04-11, 05:41 PM
  2. Replies: 4
    Last Post: 2007-08-07, 06:29 PM
  3. PHP Fatal error: Allowed memory size
    By blakegrover in forum Help
    Replies: 1
    Last Post: 2007-06-01, 01:59 PM
  4. PHP Warnings after install add-in Module
    By kgeving in forum Help
    Replies: 1
    Last Post: 2006-08-08, 05:54 PM
  5. ERROR in 4.01
    By rateck in forum Help
    Replies: 3
    Last Post: 2006-02-02, 10:00 PM

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
  •