'zlib',
];
- public $phpMemoryLimit = 128;
+ public $phpMemoryLimit = 128 * 1024 * 1024;
public $phpVersions = [
'minimum' => '8.1.2',
protected function validatePhpMemoryLimit()
{
- $this->results['php']['memoryLimit']['required'] = $this->phpMemoryLimit . 'M';
+ $this->results['php']['memoryLimit']['required'] = $this->phpMemoryLimit;
- $memoryLimit = \ini_get('memory_limit');
+ $memoryLimit = FileUtil::getMemoryLimit();
// Memory is not limited through PHP.
if ($memoryLimit == -1) {
$this->results['php']['memoryLimit']['value'] = "\u{221E}";
$this->results['php']['memoryLimit']['result'] = true;
} else {
- // Completely numeric, PHP assumes this to be a value in bytes.
- if (\is_numeric($memoryLimit)) {
- $memoryLimit = $memoryLimit / 1024 / 1024;
-
- $this->results['php']['memoryLimit']['value'] = $memoryLimit . 'M';
- $this->results['php']['memoryLimit']['result'] = ($memoryLimit >= $this->phpMemoryLimit);
- } else {
- // PHP supports the 'K', 'M' and 'G' shorthand notations.
- if (\preg_match('~^(\d+)([KMG])$~', $memoryLimit, $matches)) {
- switch ($matches[2]) {
- case 'K':
- $memoryLimit = $matches[1] / 1024;
-
- $this->results['php']['memoryLimit']['value'] = $memoryLimit . 'M';
- $this->results['php']['memoryLimit']['result'] = ($memoryLimit >= $this->phpMemoryLimit);
- break;
-
- case 'M':
- $this->results['php']['memoryLimit']['value'] = $memoryLimit;
- $this->results['php']['memoryLimit']['result'] = ($matches[1] >= $this->phpMemoryLimit);
- break;
-
- case 'G':
- $this->results['php']['memoryLimit']['value'] = $memoryLimit;
- $this->results['php']['memoryLimit']['result'] = ($matches[1] * 1024 >= $this->phpMemoryLimit);
- break;
-
- default:
- $this->results['php']['memoryLimit']['value'] = $memoryLimit;
- $this->results['php']['memoryLimit']['result'] = false;
-
- return;
- }
- }
- }
+ $this->results['php']['memoryLimit']['value'] = FileUtil::formatFilesizeBinary($memoryLimit);
+ $this->results['php']['memoryLimit']['result'] = ($memoryLimit >= $this->phpMemoryLimit);
}
$this->results['status']['php'] = $this->results['status']['php'] && $this->results['php']['memoryLimit']['result'];
<item name="wcf.acp.systemCheck.php.extension"><![CDATA[Erweiterungen]]></item>
<item name="wcf.acp.systemCheck.php.extension.description"><![CDATA[Die offiziellen Erweiterungen von PHP stellen zusätzliche Funktionen bereit, die für den Betrieb der Software notwendig sind.]]></item>
<item name="wcf.acp.systemCheck.php.memoryLimit"><![CDATA[Verfügbarer Arbeitsspeicher („memory_limit“)]]></item>
- <item name="wcf.acp.systemCheck.php.memoryLimit.description"><![CDATA[Einige Prozesse benötigen in Spitzenzeiten eine große Menge Arbeitsspeicher, für den einwandfreien Betrieb werden mindestens {$phpMemoryLimit} MB benötigt.]]></item>
+ <item name="wcf.acp.systemCheck.php.memoryLimit.description"><![CDATA[Einige Prozesse benötigen in Spitzenzeiten eine große Menge Arbeitsspeicher, für den einwandfreien Betrieb werden mindestens {$phpMemoryLimit|filesizeBinary} benötigt.]]></item>
<item name="wcf.acp.systemCheck.php.x64"><![CDATA[64-Bit-Unterstützung]]></item>
<item name="wcf.acp.systemCheck.php.x64.description"><![CDATA[Die eingesetzte PHP-Version muss die Verarbeitung von 64-Bit-Ganzzahlen unterstützen, um Zahlwerte größer als etwa 2,1 Milliarden korrekt zu verarbeiten.]]></item>
<item name="wcf.acp.systemCheck.mysql.mysqlnd"><![CDATA[MySQL Native Driver verwendet]]></item>
<item name="wcf.acp.systemCheck.php.extension"><![CDATA[Extensions]]></item>
<item name="wcf.acp.systemCheck.php.extension.description"><![CDATA[The official PHP extensions provide additional capabilities and features that are required for the software to work.]]></item>
<item name="wcf.acp.systemCheck.php.memoryLimit"><![CDATA[Available Memory (“memory_limit”)]]></item>
- <item name="wcf.acp.systemCheck.php.memoryLimit.description"><![CDATA[Processes may require large amounts of memory at peak, requiring a limit of at least {$phpMemoryLimit} MB.]]></item>
+ <item name="wcf.acp.systemCheck.php.memoryLimit.description"><![CDATA[Processes may require large amounts of memory at peak, requiring a limit of at least {$phpMemoryLimit|filesizeBinary}.]]></item>
<item name="wcf.acp.systemCheck.php.x64"><![CDATA[64-bit Support]]></item>
<item name="wcf.acp.systemCheck.php.x64.description"><![CDATA[The PHP version must support 64-bit integers to correctly process numbers larger than ~2.1 billion.]]></item>
<item name="wcf.acp.systemCheck.mysql.mysqlnd"><![CDATA[MySQL Native Driver used]]></item>