From 1cc1456bd2ced3626231fd1537e00fe17860a5e1 Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 15 Apr 2007 14:30:47 +0000 Subject: [PATCH] MDL-9363 update memory limit checks and docs; merged from MOODLE_18_STABLE --- install.php | 10 +++++----- lang/en_utf8/install.php | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/install.php b/install.php index 7c1695f1a7..adeedec3d3 100644 --- a/install.php +++ b/install.php @@ -1020,14 +1020,14 @@ function get_memory_limit() { function check_memory_limit() { - /// if limit is already 16M or more then we don't care if we can change it or not - if ((int)str_replace('M', '', get_memory_limit()) >= 16) { + /// if limit is already 40 or more then we don't care if we can change it or not + if ((int)str_replace('M', '', get_memory_limit()) >= 40) { return true; } - +return false; /// Otherwise, see if we can change it ourselves - @ini_set('memory_limit', '16M'); - return ((int)str_replace('M', '', get_memory_limit()) >= 16); + @ini_set('memory_limit', '40M'); + return ((int)str_replace('M', '', get_memory_limit()) >= 40); } //==========================================================================// diff --git a/lang/en_utf8/install.php b/lang/en_utf8/install.php index 3627cdcea3..76ce9f5c80 100644 --- a/lang/en_utf8/install.php +++ b/lang/en_utf8/install.php @@ -214,17 +214,17 @@ $string['memorylimithelp'] = '

The PHP memory limit for your server is current

This may cause Moodle to have memory problems later on, especially if you have a lot of modules enabled and/or a lot of users.

-

We recommend that you configure PHP with a higher limit if possible, like 16M. +

We recommend that you configure PHP with a higher limit if possible, like 40M. There are several ways of doing this that you can try:

  1. If you are able to, recompile PHP with --enable-memory-limit. This will allow Moodle to set the memory limit itself.
  2. If you have access to your php.ini file, you can change the memory_limit - setting in there to something like 16M. If you don\'t have access you might + setting in there to something like 40M. If you don\'t have access you might be able to ask your administrator to do this for you.
  3. On some PHP servers you can create a .htaccess file in the Moodle directory containing this line: -

    php_value memory_limit 16M

    +

    php_value memory_limit 40M

    However, on some servers this will prevent all PHP pages from working (you will see errors when you look at pages) so you\'ll have to remove the .htaccess file.

'; -- 2.39.5