4

When I run any php script I get an error sodium_init() in Unknown on line 0.

Use Ubuntu 18.04, PHP 7.2.10

Examples:

admin@server:~$ php -v
PHP Fatal error:  sodium_init() in Unknown on line 0
PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.10-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

or Composer:

admin@server:~$ php composer.phar
PHP Fatal error:  sodium_init() in Unknown on line 0
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                        /_/
Composer version 1.8.3 2019-01-30 08:31:33
...

libsodium installed:

php-libsodium/bionic,bionic,now 1.0.6-1build3 amd64 [installed]
libsodium-dev/bionic,now 1.0.16-2 amd64 [installed]
libsodium23/bionic,now 1.0.16-2 amd64 [installed]
  • Solved problem, when remove php-libsodium package. – Vladislav Feb 3 '19 at 13:24
6
sudo apt remove php-libsodium

The modern Sodium cryptography library has now become a core extension in PHP. http://php.net/manual/en/migration72.new-features.php

  • 1
    This worked perfectly. Now the question is, why didn't the package maintainers mark the php-libsodium package as conflicting with php7.2-common? – Mike Oct 17 '19 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.