Changeset 5870

Show
Ignore:
Timestamp:
07/01/08 21:42:41 (3 months ago)
Author:
p_lindheimer
Message:

try and set memory_limit when config is too small

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/htdocs/admin/common/db_connect.php

    r5765 r5870  
    7676} 
    7777 
     78// Check and increase php memory_limit if needed and if allowed on the system 
     79// 
     80$current_memory_limit = rtrim(ini_get('memory_limit'),'M'); 
     81$proper_memory_limit = '100'; 
     82if ($current_memory_limit < $proper_memory_limit) { 
     83        if (ini_set('memory_limit',$proper_memory_limit.'M') !== false) { 
     84                $nt->add_notice('core', 'MEMLIMIT', _("Memory Limit Changed"), sprintf(_("Your memory_limit, %sM, is set too low and has been increased to %sM. You may want to change this in you php.ini config file"),$current_memory_limit,$proper_memory_limit)); 
     85        } else { 
     86                $nt->add_warning('core', 'MEMERR', _("Low Memory Limit"), sprintf(_("Your memory_limit, %sM, is set too low and may cause problems. FreePBX is not able to change this on your system. You should increase this to %sM in you php.ini config file"),$current_memory_limit,$proper_memory_limit)); 
     87        } 
     88} else { 
     89        $nt->delete('core', 'MEMLIMIT'); 
     90} 
     91 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads