diff options
author | Andreas Gohr <andi@splitbrain.org> | 2008-02-23 19:07:01 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2008-02-23 19:07:01 +0100 |
commit | 73038c47e3312b4c62c4a0a05ecd5cdcd5eb95b7 (patch) | |
tree | 8fe3dd3036ba1dc2208e0b99a69eed268d6156cb /inc/infoutils.php | |
parent | 7b3f8b164b5e7b432cdee1b1332ddd9f943ed8cd (diff) | |
download | rpg-73038c47e3312b4c62c4a0a05ecd5cdcd5eb95b7.tar.gz rpg-73038c47e3312b4c62c4a0a05ecd5cdcd5eb95b7.tar.bz2 |
Check memory settings on ?do
This should help with diagnosing memory related problems
darcs-hash:20080223180701-7ad00-1308829c3d7432b1d0c23c3f1acc8228c0a41e1e.gz
Diffstat (limited to 'inc/infoutils.php')
-rw-r--r-- | inc/infoutils.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/inc/infoutils.php b/inc/infoutils.php index bc162d0e7..1fc55702e 100644 --- a/inc/infoutils.php +++ b/inc/infoutils.php @@ -89,6 +89,20 @@ function check(){ msg('PHP version '.phpversion(),1); } + $mem = (int) php_to_byte(ini_get('memory_limit')); + if($mem){ + if($mem < 16777216){ + msg('PHP is limited to less than 16MB RAM ('.$mem.' bytes). Increase memory_limit in php.ini',-1); + }elseif($mem < 20971520){ + msg('PHP is limited to less than 20MB RAM ('.$mem.' bytes), you might encounter problems with bigger pages. Increase memory_limit in php.ini',-1); + }elseif($mem < 33554432){ + msg('PHP is limited to less than 32MB RAM ('.$mem.' bytes), but that should be enough in most cases. If not, increase memory_limit in php.ini',0); + }else{ + msg('More than 32MB RAM ('.$mem.' bytes) available.',1); + } + } + + if(is_writable($conf['changelog'])){ msg('Changelog is writable',1); }else{ |