Skip to content

Commit 76fa0c3

Browse files
authored
Merge pull request #45106 from nextcloud/backport/fix-opcache-buffer-check
[stable29] fix(setupchecks): Fix opcache buffer check
2 parents d8c0da5 + 5f8157f commit 76fa0c3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/settings/lib/SetupChecks/PhpOpcacheSetup.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ protected function getOpcacheSetupRecommendations(): array {
102102
$recommendations[] = $this->l10n->t('The OPcache buffer is nearly full. To assure that all scripts can be hold in cache, it is recommended to apply "opcache.memory_consumption" to your PHP configuration with a value higher than "%s".', [($this->iniGetWrapper->getNumeric('opcache.memory_consumption') ?: 'currently')]);
103103
}
104104

105+
$interned_strings_buffer = $this->iniGetWrapper->getNumeric('opcache.interned_strings_buffer') ?? 0;
106+
$memory_consumption = $this->iniGetWrapper->getNumeric('opcache.memory_consumption') ?? 0;
105107
if (
106108
// Do not recommend to raise the interned strings buffer size above a quarter of the total OPcache size
107-
($this->iniGetWrapper->getNumeric('opcache.interned_strings_buffer') ?? $this->iniGetWrapper->getNumeric('opcache.memory_consumption') > 0 ?? 0 / 4) &&
109+
($interned_strings_buffer < ($memory_consumption / 4)) &&
108110
(
109111
empty($status['interned_strings_usage']['free_memory']) ||
110112
($status['interned_strings_usage']['used_memory'] / $status['interned_strings_usage']['free_memory'] > 9)

0 commit comments

Comments
 (0)