Where to Modify PHP OPcache Values?

NC version 29.0.1
PHP version 8.2.19
Postgres version 13.14
Linux 5.10.0-29-amd64 x86_64
Apache version unknown, but I think it’s up to date

I am not really sure, where I should add these lines in order to prevent upcoming warnings about a not properly conficured OPcache extension:

php_value opcache.memory_consumption=256
php_value opcache.interned_strings_buffer=64
php_value opcache.max_accelerated_files=100000
php_value opcache.revalidate_freq=0
php_value opcache.save_comments=1

Should I add these lines either in the root directory of my NC


or should I add these lines in



These parameters are ususally set in the php.ini file and not the .htaccess file.

But in my case, I have no access to php.ini file. The administrator of the server where my NC is hosted suggests in the user manual to alternatively modify .htaccess.

But in public_html/.htaccess I see in line 111:


In public_html/config/.htaccess I do not see such a warning. Bus as far as I understand its content, that .htaccess file does provide only information for Apache.

Afaik most of the OPcache parameters need to be set on a general level and are not instance specific. Check-out the following postings which are related to your issue/request:

Look here please:

→ opcache.configuration ←

… behind every directive you see in the “Changeable” column, where you can place the directives. What the entries in that collumn mean is described here:

→ Where a configuration setting may be set ←

Much of the directives can be defined in the file .user.ini in Nextclouds root folder.

That is definitely the wrong place!

Much and good luck,