Nextcloud warning "For improved performance and better compatibility it is highly recommended to install them: sodium"

jackdinn

Contributor
Joined
Jun 14, 2022
Messages
102
Iv just noticed this message,
This instance is missing some recommended PHP modules. For improved performance and better compatibility it is highly recommended to install them: sodium
I have had a search around but i dont know what to do (if anything). I tried pkg install php-sodium but i guess that was not correct. It dont look like its installed though.

Code:
root@nextcloud:~ # php -m
[PHP Modules]
apcu
bcmath
bz2
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gmp
hash
iconv
imagick
imap
intl
json
ldap
libsmbclient
libxml
mbstring
memcache
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
redis
Reflection
session
SimpleXML
smbclient
SPL
standard
sysvsem
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache


I originally used Danb35 script to install nextcloud.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I originally used Danb35 script to install nextcloud.
Then the discussion thread for that script would have been a better place to have asked. The current version of the script should already install this extension--when did you run the script?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
While @danb35 is of course correct, to fix an existing installation pkg search sodium should give you the name of the package to install:

Code:
root@cloud:~ # pkg search sodium
R-cran-sodium-1.3.1            R bindings to libsodium
libsodium-1.0.18               Library to build higher-level cryptographic tools
p5-Crypt-Sodium-0.11_1         Perl bindings for portable NaCL (libsodium)
php81-pecl-libsodium-2.0.23    PHP wrapper for the Sodium cryptographic library
php81-sodium-8.1.27_1          The sodium shared extension for php
php82-pecl-libsodium-2.0.23    PHP wrapper for the Sodium cryptographic library
php82-sodium-8.2.15            The sodium shared extension for php
php83-pecl-libsodium-2.0.23    PHP wrapper for the Sodium cryptographic library
php83-sodium-8.3.2             The sodium shared extension for php
py39-pysodium-0.7.17           Wrapper for libsodium providing high level crypto primitives
rubygem-rbnacl-libsodium-1.0.16 Port rbnacl with bundled libsodium


So pick the one matching your PHP version and go.
 

jackdinn

Contributor
Joined
Jun 14, 2022
Messages
102
Ok, kinda think it should be ok. Thank you chaps :smile:

Code:
root@nextcloud:~ # pkg search sodium
R-cran-sodium-1.3.1            R bindings to libsodium
libsodium-1.0.18               Library to build higher-level cryptographic tools
p5-Crypt-Sodium-0.11_1         Perl bindings for portable NaCL (libsodium)
php81-pecl-libsodium-2.0.23    PHP wrapper for the Sodium cryptographic library
php81-sodium-8.1.27            The sodium shared extension for php
php82-pecl-libsodium-2.0.23    PHP wrapper for the Sodium cryptographic library
php82-sodium-8.2.14            The sodium shared extension for php
php83-pecl-libsodium-2.0.23    PHP wrapper for the Sodium cryptographic library
php83-sodium-8.3.1             The sodium shared extension for php
py39-pysodium-0.7.17           Wrapper for libsodium providing high level crypto primitives
rubygem-rbnacl-libsodium-1.0.16 Port rbnacl with bundled libsodium
root@nextcloud:~ # php --version
PHP 8.1.17 (cli) (built: May  4 2023 01:24:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.17, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.17, Copyright (c), by Zend Technologies
root@nextcloud:~ # pkg install php81-sodium-8.1.27
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        libsodium: 1.0.18
        php81-sodium: 8.1.27
...
root@nextcloud:~ # php -m | grep sod
sodium
...
service php-fpm restart


EDIT: Yep, security warning has now gone.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
On a bit of a side note, is it necessary to remove the old php packages before installing newer ones, or will Nextcloud just start using the newer ones?
That depends on a lot of things :wink:

What do you mean by "newer ones"? php81-8.1.27_1 instead of php81-8.1.26? No problem. Restart php-fpm service or the entire jail.

php-8.2.x instead of php-8.1.y? Did you install Nextcloud from source or as a FreeBSD package? I use the FreeBSD package. That comes in multiple flavours depending on the PHP version:
Code:
root@cloud:~ # pkg search nextcloud-php
nextcloud-php81-28.0.2         Collaboration platform which runs on your own server
nextcloud-php82-28.0.2         Collaboration platform which runs on your own server
nextcloud-php83-28.0.2         Collaboration platform which runs on your own server


So if you install e.g. nextcloud-php82 with nextcloud-php81 already present that will uninstall nextcloud-php81, all PHP modules, the nextcloud package, and all other dependencies. Then install Nextcloud with a link to PHP 8.2. You might need to install individual PHP modules like sodium manually, afterwards.

That's my preferred mode of maintenance.

HTH,
Patrick
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
That depends on a lot of things :wink:

What do you mean by "newer ones"? php81-8.1.27_1 instead of php81-8.1.26? No problem. Restart php-fpm service or the entire jail.

php-8.2.x instead of php-8.1.y? Did you install Nextcloud from source or as a FreeBSD package? I use the FreeBSD package. That comes in multiple flavours depending on the PHP version:
Code:
root@cloud:~ # pkg search nextcloud-php
nextcloud-php81-28.0.2         Collaboration platform which runs on your own server
nextcloud-php82-28.0.2         Collaboration platform which runs on your own server
nextcloud-php83-28.0.2         Collaboration platform which runs on your own server


So if you install e.g. nextcloud-php82 with nextcloud-php81 already present that will uninstall nextcloud-php81, all PHP modules, the nextcloud package, and all other dependencies. Then install Nextcloud with a link to PHP 8.2. You might need to install individual PHP modules like sodium manually, afterwards.

That's my preferred mode of maintenance.

HTH,
Patrick
From source. It almost appears as of the pkg version might be better. But I like the script by @danb35 as our does everything for me.
 
Top