When running the occ setupchecks command after upgrading to v29.0.3, the following errors related to PHP OPcache configuration are encountered:
✗ PHP opcache: The PHP OPcache module is not properly configured. OPcache is not working as it should, opcache_get_status() returns false, please check configuration.
The maximum number of OPcache keys is nearly exceeded. To assure that all scripts can be kept in the cache, it is recommended to apply "opcache.max_accelerated_files" to your PHP configuration with a value higher than "10000".
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 "128"..
It appears that the OPcache checks are being performed even when opcache.enable_cli is disabled. Since OPcache is intentionally disabled for CLI calls by default, these checks should be skipped in this context.
Check if opcache.enable_cli is enabled: Before running any OPcache checks, the command should first verify whether opcache.enable_cli is enabled.
Skip checks if disabled: If opcache.enable_cli is disabled (which is a reasonable default and production value), the command should not perform any OPcache checks or return related errors.
Perform checks if enabled: If opcache.enable_cli is enabled, the command can run the OPcache checks for debugging and development purposes.
⚠️ This issue respects the following points: ⚠️
Bug description
When running the
occ setupchecks
command after upgrading to v29.0.3, the following errors related to PHP OPcache configuration are encountered:It appears that the OPcache checks are being performed even when
opcache.enable_cli
is disabled. Since OPcache is intentionally disabled for CLI calls by default, these checks should be skipped in this context.see: https://github.com/nextcloud/docker/issues/2184#issuecomment-2212576523
Steps to reproduce
occ setupchecks
command.Expected behavior
The
occ setupchecks
command should:Skip OPcache checks if
opcache.enable_cli
is disabled. Only perform OPcache checks ifopcache.enable_cli
is enabled.Installation method
Community Docker image
Nextcloud Server version
29
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.2
Web server
Apache (supported)
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
Upgraded to a MAJOR version (ex. 28 to 29)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
No response
List of activated Apps
No response
Nextcloud Signing status
No response
Nextcloud Logs
No response
Additional info
Link to conversation: https://github.com/nextcloud/docker/issues/2184#issuecomment-2082845207
Proposed Solution
opcache.enable_cli
is enabled: Before running any OPcache checks, the command should first verify whetheropcache.enable_cli
is enabled.opcache.enable_cli
is disabled (which is a reasonable default and production value), the command should not perform any OPcache checks or return related errors.opcache.enable_cli
is enabled, the command can run the OPcache checks for debugging and development purposes.