From 9f23d0d63b44ff94efa9e563edc535f3de9e6e31 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 3 Jul 2007 16:07:28 +0000 Subject: [PATCH] check memory_limit --- lam/templates/login.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lam/templates/login.php b/lam/templates/login.php index 4f724994..9adfeb22 100644 --- a/lam/templates/login.php +++ b/lam/templates/login.php @@ -65,6 +65,12 @@ for ($i = 0; $i < sizeof($writableDirs); $i++) { if (ini_get("session.auto_start") == "1") { $criticalErrors[] = array("ERROR", "Please deactivate session.auto_start in your php.ini. LAM will not work if it is activated."); } +$memLimit = ini_get('memory_limit'); +if (isset($memLimit) && ($memLimit != '') && (substr(strtoupper($memLimit), strlen($memLimit) - 1) == 'M')) { + if (intval(substr($memLimit, 0, strlen($memLimit) - 1)) < 64) { + $criticalErrors[] = array("ERROR", "Please increase the \"memory_limit\" parameter in your php.ini to at least \"64M\"."); + } +} // stop login if critical errors occured if (sizeof($criticalErrors) > 0) { echo "\n";