mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
Removing memory limit sanity check
Summary: Turns out that 12 characters is not enough for folks that have memory_limit set to INT64_MAX (9223372036854775807). Since this only seems to have affected a single installation, epriestley says let's get rid of it. If it comes up again, we can restore the check but use a bigger number. Test Plan: Just make a call to the phabricator webroot. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T1641 Differential Revision: https://secure.phabricator.com/D3246
This commit is contained in:
parent
b2c9edd17d
commit
4eebd545ce
1 changed files with 0 additions and 30 deletions
|
@ -36,8 +36,6 @@ if (version_compare(PHP_VERSION, $required_version) < 0) {
|
|||
"'{$required_version}'.");
|
||||
}
|
||||
|
||||
phabricator_detect_insane_memory_limit();
|
||||
|
||||
ini_set('memory_limit', -1);
|
||||
|
||||
$env = getenv('PHABRICATOR_ENV'); // Apache
|
||||
|
@ -326,34 +324,6 @@ function phabricator_detect_bad_base_uri() {
|
|||
}
|
||||
}
|
||||
|
||||
function phabricator_detect_insane_memory_limit() {
|
||||
$memory_limit = ini_get('memory_limit');
|
||||
$char_limit = 12;
|
||||
if (strlen($memory_limit) <= $char_limit) {
|
||||
return;
|
||||
}
|
||||
|
||||
// colmdoyle ran into an issue on an Ubuntu box with Suhosin where his
|
||||
// 'memory_limit' was set to:
|
||||
//
|
||||
// 3232323232323232323232323232323232323232323232323232323232323232M
|
||||
//
|
||||
// Not a typo. A wizard did it.
|
||||
//
|
||||
// Anyway, with this 'memory_limit', the machine would immediately fatal
|
||||
// when executing the ini_set() later. I wasn't able to reproduce this on my
|
||||
// EC2 Ubuntu + Suhosin box, but verified that it caused the problem on his
|
||||
// machine and that setting it to a more sensible value fixed it. Since I
|
||||
// have no idea how to actually trigger the issue, we look for a coarse
|
||||
// approximation of it (a memory_limit setting more than 12 characters in
|
||||
// length).
|
||||
|
||||
phabricator_fatal_config_error(
|
||||
"Your PHP 'memory_limit' is set to something ridiculous ".
|
||||
"(\"{$memory_limit}\"). Set it to a more reasonable value (it must be no ".
|
||||
"more than {$char_limit} characters long).");
|
||||
}
|
||||
|
||||
function phabricator_shutdown() {
|
||||
$event = error_get_last();
|
||||
|
||||
|
|
Loading…
Reference in a new issue