Page MenuHomePhabricator

help installer deal with memory_limit being too low to load installer i18n
Open, MediumPublic

Description

Author: sumanah

Description:
<^demon|busy> sumanah: I don't have time for it today, but this is something we should look at later: how to deal with the installer if memory_limit is too low to load installer i18n.


Version: 1.21.x
Severity: normal

Details

Reference
bz41896

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:50 AM
bzimport set Reference to bz41896.
bzimport added a subscriber: Unknown Object (MLST).

sumanah wrote:

Today a sysadmin tried to install MediaWiki and got the error:

"Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 1966080 bytes) in /home/a8130601/public_html/wiki/includes/installer/Installer.i18n.php on line 7114"

Solution Chad suggested: "At the very top of mw-config/index.php, add the following:

ini_set( 'memory_limit', '100M' );

(Right after the <?php, that is)

And you're also going to want to add a similar line to your LocalSettings.php, after you've finished installing."

I presume this is one of the situations Chad wants us to eventually address. :)

That's the exact scenario.

Basically, if your memory_limit is too low, you could fail to get past the initial installer page (where you select your language) to where we complain about memory_limit being too low during environment checks. We should probably silently raise it for the installer (if we can, more below).

We should still warn at the environment stage that we're raising the limit, so people are aware their php.ini memory_limit is too low and it's being overridden.

If you're on a super-locked-down host (ini_set() is disabled, etc), there's nothing we can do if your memory limit is too low. Best case would be to detect this scenario and bail immediately with an error.

And you're also going to want to add a similar line to your LocalSettings.php,
after you've finished installing."

Note, we already raise the memory somewhat in Setup.php which is run right after LocalSettings.php. See $wgMemoryLimit wfMemoryLimit() in GlobalFunctions.php.

Doesn't the move to json files in MW 1.24 fix this issue?