Jump to:

23377 Posts in 18296 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » PHP Memory Limit error preventing me from logging in

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2051 Views
  • doubleedesign
    Avatar
    Community Member
    19 Posts

    PHP Memory Limit error preventing me from logging in Link to this post

    Hi All,

    I'm having a problem with my PHP memory limit. When trying to go to the admin login page, I get this error:

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 491520 bytes) in /home/meltscom/public_html/silverstripe-cache/.cache.home.meltscom.public_html.sapphire.template s.TableListField.ss on line 622

    I have tried changing php.ini to memory_limit = 256M manually, but it doesn't help. What else can I do to up the limit to prevent this from happening?

    I've also tried changing max_execution_time to 1000. I have also found and corrected ini_set('memory_limit', '256M'); in sapphire/_config.php, and added the same line to mysite/_config.php.

    Edit: I have run phpinfo, which confirms the memory limit is set to 256M....so I'm very stuck now

    Edit: I found in another thread a suggestion to add php_value memory_limit 256M to the .htaccess file, I was just wondering where to add it because adding that exact line at the bottom of the .htaccess file in the root folder causes an Internal Server Error for the entire site (not just the admin page as the original error did).

  • swaiba
    Avatar
    Forum Moderator
    1785 Posts

    Re: PHP Memory Limit error preventing me from logging in Link to this post

    Hi,

    I'd do the normal debugging stuff and find out what it is that is causing the issue...

    http://doc.silverstripe.org/sapphire/en/installation/common-problems
    http://www.leftandmain.com/silverstripe-tips/2010/09/08/8-common-silverstripe-errors-explained-and-solved/

    I have this recently with an image that on upload went from 1.3MB to 13MB and it was then being scalled down - I could see the GD section of code and filename and could then manually change the image. So you should be able to find something that indicates the issue and you can make a db/code/asset change to fix...

  • doubleedesign
    Avatar
    Community Member
    19 Posts

    Re: PHP Memory Limit error preventing me from logging in Link to this post

    Hi all,
    I had someone contact me about this post because they were having the same issue, so I thought I would post the solution here for the benefit of anyone else who needs it.

    It was a friend of mine who found the solution to this one. In the home directory you should have a php.ini file (or if not, create one - contact your host if you don't know how to do it, mine has a tool that generates it). Then increase the memory limit setting to 128M or higher.

    This alone however may not solve it. What solved it for me, as my friend worked out, is to put a copy of the php.ini file inside the sapphire directory as well as in the home directory. I honestly don't know why this works, maybe sapphire accesses something else by default and this overrides it, I don't know, but this worked for me.

    Hope this is helpful!

    2051 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.