Sodium PHP extension

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via 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:


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


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): 27.1.1
Operating system and version (eg, Ubuntu 20.04): RH EL 9.2
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.53-11
PHP version (eg, 7.4): 8.1.14-1

The issue you are facing: When I logon as an administrator user, under “Administration settings” I can see a message which tells me that the “sodium” PHP module is missing.
but it seems that the sodium package is not available for my version of PHP:

[root@linuxNC ~]# pecl install libsodium
pecl/libsodium requires PHP (version >= 7.0.0, version <= 8.0.99), installed version is 8.1.14
No valid packages found
install failed

Am I wrong?
In case I am not, what about that warning message that shows that the “sodium” module is missing?

Is this the first time you’ve seen this error? No

Steps to replicate it: Access to the “Administration settings” as an administration user

The output of your Nextcloud log in Admin > Logging:


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

$CONFIG = array (
  'instanceid' => 'oc3qhcuc9rfv',
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' =>
  array (
    0 => '',
    1 => '',
    2 => '',
  'datadirectory' => '/opt/ncintra/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => '',
  'dbname' => 'ncintra',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '***',
  'dbpassword' => '***',
  'installed' => true,
  'overwriteprotocol' => 'https',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
    'timeout' => 0.0,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'NC',
  'mail_domain' => '',
  'mail_smtphost' => '***',
  'mail_smtpport' => '587',
  'maintenance' => false,
  'loglevel' => 2,
  'debug' => false,
  'allow_local_remote_servers' => true,
  'mail_smtpauth' => 1,
  'mail_smtpname' => '***',
  'mail_smtppassword' => '***',

The output of your Apache/nginx/system log in /var/log/____:

nothing about the error mentioned in that log file

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

nothing important

It seems like Red Hat doesn’t redistribute sodium.
PHP is supposed to be bundled with sodium starting with PHP 7.2, but RH explicitely compiles it without it. Apparently you can get it using Remi’s repo

Someone also says you can force PECL to install libsodium even though the version doesn’t match.

thank you very much for your help. I forced the installation and I got successful.
As you were so kind, I am asking for more help as now I have another problem.
Now the sodium is installed, but I still have the warning:

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


[root@linuxNC ~]# php -i | grep -i sodium
sodium support => enabled
sodium compiled version => 2.0.23
libsodium headers version => 1.0.18
libsodium library version => 1.0.18
[root@linuxNC ~]#

it seems that it happens because I miss “argon2”, correct? If yes, is it possibile to install argon2 in my system?