Page MenuHomePhabricator

Raise PHP memory limit for command line
Closed, ResolvedPublic

Description

The PHP memory limit for the command line is 50M, which comes from the default wgMemoryLimit, which is a lower bound ("MediaWiki will try to raise PHP's memory limit if it's below this amount").

That can be too low in some cases when a few extensions are loaded.

The command line limit is actually set to -1 in /etc/php5/cli/php.ini . However, due to an issue with phpsh (https://github.com/facebook/phpsh/issues/49), that gets set to -2M, which MW then raises to 50M.

The solution is to set /etc/php5/cli.php.ini to something suitably high, specified in megabytes. For comparison, the Apache php.ini have 128M. It might also be good to set wgMemoryLimit to the same value, just so people don't get confused reading the setting files.


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=34241

Details

Reference
bz56066

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:28 AM
bzimport set Reference to bz56066.

Fixed in Ori's version of phpsh instead (https://github.com/atdt/phpsh/commit/8a47fac3aaa85b8e1c379a7af73eb6a0f908dc5b), which is now use for MediaWiki-Vagrant (done in https://gerrit.wikimedia.org/r/#/c/103049/).

So we can keep using -1 for the CLI memory limit.