diff --git a/install.php b/install.php index e3eb3a4..b3bc86d 100644 --- a/install.php +++ b/install.php @@ -6,6 +6,8 @@ */ ini_set('max_execution_time', 300); + +session_start(); // Load database config if(isset($_REQUEST['mysql'])) { @@ -175,9 +177,18 @@ class InstallRequirements { } } - function requireMemory($min, $recommended, $testDetails) { + function requireMemory($min, $recommended, $testDetails) { + $_SESSION['forcemem'] = false; + + $mem = $this->getPHPMemory(); + if($mem < (32 * 1024 * 1024)) { + $_SESSION['forcemem'] = true; + ini_set('memory_limit', '32M'); + $mem = $this->getPHPMemory(); + $testDetails[3] = ini_get("memory_limit"); + } + $this->testing($testDetails); - $mem = $this->getPHPMemory(); if($mem < $min && $mem > 0) { $testDetails[2] .= " You only have " . ini_get("memory_limit") . " allocated"; @@ -524,7 +535,6 @@ class InstallRequirements { class Installer extends InstallRequirements { function install($config) { - session_start(); ?>

Installing SilverStripe...

I am now running through the installation steps (this should take about 30 seconds)

@@ -579,7 +589,9 @@ class Installer extends InstallRequirements { // downloaded from http://www.silverstripe.com/cms-themes-and-skin SSViewer::set_theme('blackcandy'); PHP; - } + } + + $mem = $_SESSION['forcemem'] ? "ini_set('memory_limit', '32M');" : ''; echo "
  • Creating '$template/_config.php'...
  • "; flush(); @@ -588,8 +600,8 @@ PHP; $this->createFile("$template/_config.php", <<