Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » PHP memory limit problem

Our old forums are still available as a read-only archive.

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

Page: 1 2
Go to End
Author Topic: 6877 Views
  • Jagged
    Avatar
    Community Member
    2 Posts

    Re: PHP memory limit problem Link to this post

    I tried to install SS on my development machine running Vertrigo WAMP and had simlar issues with a null memory limit. I tracked it down to the fact that PHP was compiled without --enable-memory-limit.
    If you do choose to subvert the installation by editing the install.php file, then you should be fine as there will be no limit at all on the memory.
    However, this is a security risk on shared servers as any Idiot can bring the server to it's knees with a recursive function.

    Considering the fact that most/all Apache installations on windows are compiled without --enable-memory-limit since it is not supported on windows, I suggest the following patch:
    function requireMemory($min, $recommended, $testDetails) {
          $this->testing($testDetails);
          $mem = $this->getPHPMemory();
          if (!$mem) {
             $testDetails[2] .= " You have PHP compiled without --enable-memory-limit";
             $this->warning($testDetails);
          } else {
          if($mem < $min) {
             $testDetails[2] .= " You only have " . ini_get("memory_limit") . " allocated";
             $this->error($testDetails);
          } else if($mem < $recommended) {
             $testDetails[2] .= " You only have " . ini_get("memory_limit") . " allocated";
             $this->warning($testDetails);
          }}
       }   
    to config-form.html:

    <?php if($hasErrorOtherThanDatabase) { ?>
    <p class="error">You aren't currently able to install the software. Please <a style="color: #CCF" href="#requirements">see below</a> for details.</p>
    <?php } else { ?>
    <?php if($req->hasWarnings()) { ?>
    <p class="warning">There are some issues that we recommend you look at before installing, however, you are still able to install the software. Please see below for details.</p>
    <?php } else if(!$dbReq->hasErrors()) { ?>
    <p class="good">You're ready to install! &nbsp;&nbsp;
    </p>
    <?php } ?>

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: PHP memory limit problem Link to this post

    Thanks for the patch, Jagged - we'll be putting this into version 2.0.0, due out very soon.

  • Matt
    Avatar
    Core Development Team
    84 Posts

    Re: PHP memory limit problem Link to this post

    This has been fixed in our latest version (cheers Jagged, that's pretty much exactly what we did), due out shortly.

    You will be able to install SilverStripe if you have between 20 MB and 32 MB of memory allocated, and also if we can't determine what the value of memory_limit is.

    6877 Views
Page: 1 2
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.