I'm trying to apply override PHP's opcache.max_accelerated_files
setting via geerlingguy's Ansible Role for PHP onto geerlingguy/centos6's VM using the following lines (as part of provisioning script):
php_opcache_enabled_in_ini: false
php_opcache_enable_cli: 1
php_opcache_max_accelerated_files: "4096"
This seems to work (as 10-opcache.ini
is created in /etc/php.d
) as:
opcache.enable=1
opcache.enable_cli=1
opcache.max_accelerated_files=8192
however the option is still not overridden for PHP:
$ php -i | grep opcache.max_accelerated_files
opcache.max_accelerated_files => 4000 => 4000
This is because opcache.ini
has already this settings set:
$ grep ^opcache.max_accelerated_files opcache.ini
opcache.max_accelerated_files=4000
and somehow it takes precedence over 10-opcache.ini
.
I've tried to change default php_opcache_conf_filename
to opcache.ini
, but then 10-opcache.ini
got overridden and wiped out the previous content (including zend_extension=opcache.so
line), so OPcache got disabled.
How do I change PHP setting using ansible role for PHP, so the setting is applied correctly which would override the previous value?
I think that's because
10-opcache.ini
is beforeopcache.ini
in alphabetic order, which is relevant for load order. So the config ofopcache.ini
is the last one applied.You can change the filename to something like
zzz-opcache.ini
or my prefered way add azzz-custom.ini
with all your custom configs in one file.On the other hand, why would you have two files for opcache? can you combine them into one?