Problem
The Nextcloud administration overview reports:
The PHP OPcache module is not properly configured. The OPcache buffer is nearly full. To assure that all scripts can be held in cache, it is recommended to apply
opcache.memory_consumptionwith a value higher than128.
In the current NethServer 8 Nextcloud implementation (ghcr.io/nethserver/nextcloud-app:1.7.0), there is no documented or obvious way to persistently override PHP settings such as:
opcache.memory_consumptionopcache.max_accelerated_filesopcache.interned_strings_buffer- other PHP-FPM and PHP runtime parameters
The container uses internal configuration files under:
/usr/local/etc/php/conf.d/
but these files are recreated whenever the container is rebuilt or updated.
Current Situation
Administrators can temporarily modify PHP settings inside the running container, for example:
opcache.memory_consumption=512
However, such changes are lost when:
- the application is updated,
- the container is recreated,
- the application is restored from backup,
- NethServer regenerates the container.
Requested Enhancement
Provide an officially supported mechanism to persist PHP overrides for Nextcloud applications.
Possible implementations:
Option 1: UI Configuration
Add a section in the Nextcloud application settings:
PHP Configuration Overrides
allowing administrators to define custom PHP directives.
Option 2: Persistent Custom INI File
Provide a host-side file such as:
~/.config/state/php-custom.ini
which is automatically mounted into the container and loaded after the default configuration.
Option 3: Advanced Configuration Field
Add support for custom PHP settings in the application configuration JSON.
Benefits
- Resolves OPcache warnings without modifying containers manually.
- Survives updates and container recreation.
- Reduces support requests related to PHP tuning.
- Allows administrators to optimize larger Nextcloud installations.
- Aligns with the persistent configuration model already used for Nginx and PHP-FPM settings.
Example Use Cases
opcache.memory_consumption=512
opcache.max_accelerated_files=20000
opcache.interned_strings_buffer=64
memory_limit=2G
upload_max_filesize=10G
post_max_size=10G
These settings are commonly required for medium and large Nextcloud deployments and should be configurable without modifying the container image.