Unable to fix that "PHP OPcache not properly configured" warning!

Nextcloud version (eg, 12.0.2): 13.0.6
Operating system and version (eg, Ubuntu 17.04): Raspbian Linux 8.0 (jessie)
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.25
PHP version (eg, 7.1): 7.0

The issue I am facing:
Going to Administration > Basic Settings, I get the following warning:

The PHP OPcache is not properly configured. For better performance it is recommended to use the following settings in the php.ini:
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1

I’ve Google-searched this & resolved the issue in the past. But after some update (not sure how many updates ago), the warning came back and I can’t fix it this time.

I’ve added those items to the following locations:

/etc/php/7.0/cli/php.ini
/etc/php/7.0/fpm/php.ini
/etc/php/7.0/mods-available/opcache.ini

At first I tried adding the values to those files one at a time, then I added to all 3 at the same time. I also give it a systemctl restart apache2 after each modification.

I also just went and did php -a on the command line and typed phpinfo();. Here’s the relevant output regarding opcache:

Zend OPcache

Opcode Caching => Up and Running
Optimization => Enabled
SHM Cache => Enabled
File Cache => Disabled
Startup => OK
Shared memory model => mmap
Cache hits => 0
Cache misses => 0
Used memory => 16183240
Free memory => 118034488
Wasted memory => 0
Interned Strings Used memory => 186800
Interned Strings Free memory => 8201808
Cached scripts => 0
Cached keys => 0
Max keys => 16229
OOM restarts => 0
Hash keys restarts => 0
Manual restarts => 0

Directive => Local Value => Master Value
opcache.blacklist_filename => no value => no value
opcache.consistency_checks => 0 => 0
opcache.dups_fix => Off => Off
opcache.enable => On => On
opcache.enable_cli => On => On
opcache.enable_file_override => Off => Off
opcache.error_log => no value => no value
opcache.fast_shutdown => 1 => 1
opcache.file_cache => no value => no value
opcache.file_cache_consistency_checks => 1 => 1
opcache.file_cache_only => 0 => 0
opcache.file_update_protection => 2 => 2
opcache.force_restart_timeout => 180 => 180
opcache.huge_code_pages => Off => Off
opcache.inherited_hack => On => On
opcache.interned_strings_buffer => 8 => 8
opcache.lockfile_path => /tmp => /tmp
opcache.log_verbosity_level => 1 => 1
opcache.max_accelerated_files => 10000 => 10000
opcache.max_file_size => 0 => 0
opcache.max_wasted_percentage => 5 => 5
opcache.memory_consumption => 128 => 128
opcache.optimization_level => 0x7FFFBFFF => 0x7FFFBFFF
opcache.preferred_memory_model => no value => no value
opcache.protect_memory => 0 => 0
opcache.restrict_api => no value => no value
opcache.revalidate_freq => 1 => 1
opcache.revalidate_path => Off => Off
opcache.save_comments => 1 => 1
opcache.use_cwd => On => On
opcache.validate_permission => Off => Off
opcache.validate_root => Off => Off
opcache.validate_timestamps => On => On

So it looks like those values are being set correctly. Right?

Now I do have PHP 5.6.36 installed as well for another application, but I’m quite certain Nextcloud is using 7.0. However, is there a way I can verify that?

No suggestions?

Log in as admin with your browser. Go to settings -> monitoring. Scroll down. There are some information about php, including version.

Ok, now I’m not getting that warning… I had to reboot after modifying php.ini. All checks have passed. Anyway, version #s are as follows

PHP
Version: 7.0.30
Memory Limit: 512 MB
Max Execution Time: 3600
Upload max size: 511 MB

Database
Type: mysql
Version: 10.1.23
Size: 17.4 MB

And I know I’ve upped the max upload size to 2 GB before, but for some reason it’s back to 511 MB… Is that from an update? And I can never change it through the UI, only by manually modifying a file on the server. Is that normal?

No normally you can set it via the Web UI and it will work. There is however a setting in the .htaccess as well pertaining to upload file sizes etc.

I can’t solve the problem either.
Nextcloud: 18.0.11
PHP-FPM: Version 7.4.13
The warning is Nextcloud registry is:

"Zend OPcache can't be temporary enabled (it may be only disabled till the end of request) at Unknown#0"
However the PHP OPCache is enabled in this web via php.ini.
phpinfo() show the following information:

Zend opcache:

Opcode Caching Up and Running
Optimization Enabled
SHM Cache Enabled
File Cache Disabled
Startup OK
Shared memory model mmap
Cache hits 35524
Cache misses 946
Used memory 22291640
Free memory 111926088
Wasted memory 0
Interned Strings Used memory 2929352
Interned Strings Free memory 3361656
Cached scripts 946
Cached keys 1785
Max keys 16229
OOM restarts 0
Hash keys restarts 0
Manual restarts 0
Directive Local Value Master Value
opcache.blacklist_filename no value no value
opcache.consistency_checks 0 0
opcache.dups_fix Off Off
opcache.enable On On
opcache.enable_cli On On
opcache.enable_file_override Off Off
opcache.error_log /var/log/php-opcache.log /var/log/php-opcache.log
opcache.file_cache no value no value
opcache.file_cache_consistency_checks On On
opcache.file_cache_only Off Off
opcache.file_update_protection 2 2
opcache.force_restart_timeout 180 180
opcache.huge_code_pages Off Off
opcache.interned_strings_buffer 8 8
opcache.lockfile_path /tmp /tmp
opcache.log_verbosity_level 1 1
opcache.max_accelerated_files 10000 10000
opcache.max_file_size 0 0
opcache.max_wasted_percentage 5 5
opcache.memory_consumption 128 128
opcache.opt_debug_level 0 0
opcache.optimization_level 0x7FFEBFFF 0x7FFEBFFF
opcache.preferred_memory_model no value no value
opcache.preload no value no value
opcache.preload_user no value no value
opcache.protect_memory Off Off
opcache.restrict_api no value no value
opcache.revalidate_freq 1 1
opcache.revalidate_path Off Off
opcache.save_comments On On
opcache.use_cwd On On
opcache.validate_permission Off Off
opcache.validate_root Off Off
opcache.validate_timestamps On On

There must are some additional configuration in Nextcloud config.php to recognize PHP opcache?

Which OS are you running? Opcache is normally configured via different file than php.ini.