Extra PHP memory limit options

Extra PHP memory limit options

by Matthew Switlik -
Number of replies: 1

How can I allow for the selection of 1536M, and 2048M for extramemorylimit via the menu?

under Site administration -> Server -> Performance

the Extra PHP memory limit can not be set higher than 1024M.

I tried editing the php.ini file's memory_limit to 1536M doesn't allow the selection of higher values in the menu for extramemorylimit.  This also raises it for ALL php not just the backup and restore scripts etc.

I don't want to insert an ini_set("memory_limit","2048M"); into grade/import/csv/index.php if I can help it.

 

Average of ratings: -
In reply to Matthew Switlik

Re: Extra PHP memory limit options

by Ken Task -
Picture of Particularly helpful Moodlers

A hack to /moodle/admin/settings/server.php

line 177 begins // performance settingpage
options in the pick list are hard coded beginning
line 185
One could add lines in the array.

'1536M' => '1536M',
'2048M' => '2048M'

make sure the line above the entry for 1536M ends with a ','

Values added will show in the pick list.  Probably don't have to warn about hacks and updates, but just did. ;)

Another way ... add a line to config.php file:

$CFG->extramemorylimit = 'YOURVALUEM';

And for future reference, just about anything in mdl_conf table could be added to config.php.  Might be better than the hack - easy to change.

'spirit of sharing', Ken