check memory_limit

This commit is contained in:
Roland Gruber 2007-07-03 16:07:28 +00:00
parent 150825fdd0
commit 9f23d0d63b
1 changed files with 6 additions and 0 deletions

View File

@ -65,6 +65,12 @@ for ($i = 0; $i < sizeof($writableDirs); $i++) {
if (ini_get("session.auto_start") == "1") { 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."); $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 // stop login if critical errors occured
if (sizeof($criticalErrors) > 0) { if (sizeof($criticalErrors) > 0) {
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";