OPcache spooky actions from afar

Nextcloud version 13.05
Operating system and version Ubuntu 16.04
Apache or nginx Apache 2.4.18
PHP version (eg, 7.1): 7.0.30-0ubuntu0.16.04.1

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

Is this the first time you’ve seen this error? (Y/N): Y

Results of running,

php --ini


/etc/php/7.0/cli/php.ini

So, only changing the php.ini in the cli dir as shown did not correct the problem in nextcloud
BUT running

php -i grep 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 => 18734928
Free memory => 115482800
Wasted memory => 0
Interned Strings Used memory => 367384
Interned Strings Free memory => 8021224
Cached scripts => 0
Cached keys => 0
Max keys => 16229
OOM restarts => 0
Hash keys restarts => 0
Manual restarts => 0

Strange, php was ok, but nextcloud wasnt…

After editing /etc/php/7.0/apache2/php.ini
all was good with nextcloud

Is this normal behavior ?

Yes. The cli (command line interface)-php.ini is the configuration for the php you run from command line. The apache2-php.ini is the one used by the apache-php-module! So if you want the output of the configuration, it is better to put a php-file in your document root (<?php phpinfo(); ?>) in order to get the configuration settings used by the webserver (should also take into account possible configuration changes via .htaccess).