Where/how to set opcache settings on shared webhost?

Hi all… just trying to finish cleaning up a new install but can’t find a way to setup the opcache settings. I don’t know much about web/network software.

  • shared webhost - a2hosting
  • CloudLinux 7.6 (CentOS based)
  • Nextcloud 15.0.2
  • PHP 7.3
  • NC is the only thing I’ve added. Otherwise this is a new ‘machine’.

On the NC admin/overview page I get the following warning:
The PHP OPcache is not properly configured.…then a list of settings

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

No errors in Logging.
opcache is enabled


What I’ve tried:

  • add the suggested settings in /opt/alt/php73/etc/php.ini but I don’t have write access. (phpinfo() points to this php.ini)
  • making a copy of php.ini in my public_html folder where NC resides. Then added the settings. No luck - no change in admin/overview warning.
  • adding them to config/config.php. No luck.
  • adding the settings to .user.ini. No luck.
  • same but using a different form, php_value[opcache.enable] = 1…etc. No luck.

Maybe I needed to somehow point php to www/php.ini ??

Out of ideas and ran out of hits searching for clues.
Suggestions?

Ask your webhost if they support OPcache on shared hosting… i assume they are not.

I submitted a ticket asking them. Meanwhile… from phpinfo(), here’s the opcache bits.
Not positive what type of caching NC wants.

Zend OPcache

Opcode Caching => Disabled
Optimization => Disabled
SHM Cache => Enabled
File Cache => Disabled
Startup Failed => Opcode Caching is disabled for CLI

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 => Off => Off
opcache.enable_file_override => Off => Off
opcache.error_log => no value => no value
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.interned_strings_buffer => 4 => 4
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.protect_memory => 0 => 0
opcache.restrict_api => no value => no value
opcache.revalidate_freq => 2 => 2
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