The PHP OPcache module is not properly configured. And sodium module says it's not loading

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 21.0.5
Operating system and version (eg, Ubuntu 20.04): CentOS 7
Apache or nginx version (eg, Apache 2.4.25): Apache Apache/2.4.48
PHP version (eg, 7.4): PHP-FPM 8.0.11

I initially updated from 21.0.4 to 21.0.5 and began getting two errors in my Security & Setup Warnings. The first one is:

The PHP OPcache module is not properly configured.
opcache.enable=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1

This simply states what I have already had in the php.ini. The second error displayed is:

  • This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them.
    sodium

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

Steps to replicate it:

  1. Update from 21.0.4 to 21.0.5 - updated to 22.2.0 thinking it might be fixed and it behaves the same.
  2. I only updated PHP-FPM after the warnings showed up, I was running PHP-FPM 8.0.9

The output of your Nextcloud log in Admin > Logging:

Can't locate?

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'secret',
  'passwordsalt' => 'secret',
  'secret' => 'secret',
  'trusted_domains' => 
  array (
    0 => 'secret',
  ),
  'datadirectory' => '/secret',
  'dbtype' => 'mysql',
  'version' => '22.2.0.2',
  'overwrite.cli.url' => 'secret',
  'dbname' => 'secret',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'secret',
  'dbpassword' => 'secret',
  'installed' => true,
  'integrity.check.disabled' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'theme' => '',
  'maintenance' => false,
  'mail_domain' => 'secret',
  'mail_smtpmode' => 'sendmail',
  'mail_sendmailmode' => 'pipe',
  'mail_from_address' => 'vapor',
  'mail_smtphost' => 'secret',
  'mail_smtpport' => '25',
  'default_phone_region' => 'US',
  'loglevel' => 3,
  'logdateformat' => 'F d, Y H:i:s',
  'logtimezone' => 'America/New_York',
  'has_internet_connection' => true,
  'connectivity_check_domains' => 
  array (
    0 => 'secret',
    1 => 'secret',
    2 => 'secret',
    3 => 'secret',
  ),
  'updater.release.channel' => 'stable',
  'app_install_overwrite' => 
  array (
    0 => 'rainloop',
  ),
);

PHP -m

[PHP Modules]
apcu
bcmath
brotli
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imagick
imap
intl
json
libxml
mailparse
mbstring
mcrypt
memcache
memcached
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
pspell
redis
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
ssh2
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
uploadprogress
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

php -i | grep -i opcache

/opt/alt/php-fpm80/usr/php/php.d/opcache.ini,
    with Zend OPcache v8.0.11, Copyright (c), by Zend Technologies
Zend OPcache
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.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.jit => tracing => tracing
opcache.jit_bisect_limit => 0 => 0
opcache.jit_blacklist_root_trace => 16 => 16
opcache.jit_blacklist_side_trace => 8 => 8
opcache.jit_buffer_size => 0 => 0
opcache.jit_debug => 0 => 0
opcache.jit_hot_func => 127 => 127
opcache.jit_hot_loop => 64 => 64
opcache.jit_hot_return => 8 => 8
opcache.jit_hot_side_exit => 8 => 8
opcache.jit_max_exit_counters => 8192 => 8192
opcache.jit_max_loop_unrolls => 8 => 8
opcache.jit_max_polymorphic_calls => 2 => 2
opcache.jit_max_recursive_calls => 2 => 2
opcache.jit_max_recursive_returns => 2 => 2
opcache.jit_max_root_traces => 1024 => 1024
opcache.jit_max_side_traces => 128 => 128
opcache.jit_prof_threshold => 0.005 => 0.005
opcache.lockfile_path => /tmp => /tmp
opcache.log_verbosity_level => 1 => 1
opcache.max_accelerated_files => 5000 => 5000
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.record_warnings => Off => Off
opcache.restrict_api => no value => no value
opcache.revalidate_freq => 60 => 60
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

opcache has been moved into opcache.ini You don’t need to set it in php.ini on CentOS 7

I am still experiencing the sodium error, looks like something in Nextcloud.

It’s nothing in Nextcloud but a not loaded php module on your web server. Please have a look on the following posting which describes how to check which PHP web modules are loaded.