From dea7b9074d6afcd68adb15751f9c46e1a999da70 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Tue, 12 Feb 2019 14:39:58 -0500 Subject: [PATCH] Hack to disable memory limit for values in Gigabytes --- lib/functions.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/functions.php b/lib/functions.php index e75277b..0e5c5d6 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -326,10 +326,12 @@ function check_config($config_file) { $config->setServers($servers); # Check the memory limit parameter. - if ((ini_get('memory_limit') > -1) && ini_get('memory_limit') < $config->getValue('session','memorylimit')) + $ini_limit = ini_get('memory_limit'); + $ini_limit = str_replace('G', 1024 * 1024 * 1024 * (int)$ini_limit, $ini_limit); + if ((ini_get('memory_limit') > -1) && $ini_limit < $config->getValue('session','memorylimit')) system_message(array( 'title'=>_('Memory Limit low.'), - 'body'=>sprintf('Your php memory limit is low - currently %s, you should increase it to atleast %s. This is normally controlled in /etc/php.ini.', + 'body'=>sprintf('Your php memory limit is low - currently %s, you should increase it to at least %s. This is normally controlled in /etc/php.ini.', ini_get('memory_limit'),$config->getValue('session','memorylimit')), 'type'=>'error'));