From 9f5eea7b013c9d637d48f8f1c921ac7a79828d8b Mon Sep 17 00:00:00 2001 From: MichaIng Date: Wed, 23 Nov 2022 15:35:41 +0100 Subject: [PATCH] Check for opcache.file_cache_only=1 which disables shared memory based OPcache with disk file cache used only, if enabled. In this case, "opcache.memory_consumption" and others do not apply, so show the correct performance recommendation to enable memory cache. Signed-off-by: MichaIng --- apps/settings/lib/Controller/CheckSetupController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 70eac9a7ac419..4d03309b55070 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -499,6 +499,8 @@ protected function getOpcacheSetupRecommendations(): array { } } elseif (!$isPermitted) { $recommendations[] = $this->l10n->t('Nextcloud is not allowed to use the OPcache API. It is highly recommended to include all Nextcloud directories with opcache.restrict_api or unset this setting to disable OPcache API restrictions, to prevent errors during Nextcloud core or app upgrades.'); + } elseif ($this->iniGetWrapper->getBool('opcache.file_cache_only')) { + $recommendations[] = $this->l10n->t('The shared memory based OPcache is disabled. For better performance, it is recommended to apply opcache.file_cache_only=0 to your PHP configuration and use the file cache as second level cache only.'); } else { // Check whether opcache_get_status has been explicitly disabled an in case skip usage based checks $disabledFunctions = $this->iniGetWrapper->getString('disable_functions');