1

I take a Magento project and when i run x debug I have an exception because libsodium is not installed then I went to install libsodium.
I then follow this tutorial https://lukasmestan.com/install-libsodium-extension-in-php7/ (because I have php 7.2 as it is a Magento project) and ... it didn't work out :(
When I do :

sudo pecl install -f libsodium  

I have the problem :

checking for libsodium... configure: error: Please install libsodium ERROR: `/var/tmp/libsodium/configure --with-php-config=/bin/php-config' failed

Do someone had the same problem ? I mean installing libsodium is what I want to do and for do that I need to install libsodium XD
If someone have a solution I would really be glad.
PS: in case of minus please let me know why so that I can improve my post

  • I am not sure about Centos but I use PHP 7.3 with Debian 10. Try installing PHP 7.3 on Centos. – Saud Iqbal Sep 28 '19 at 20:48
  • @SaudIqbal unfortunalty I need libsodium for a Magento product which need php 7.1 (because Magento need my_crypr php library which is deleted from php 7.2 as far as I read in doc) –  Sep 30 '19 at 07:21

3 Answers3

3

Ok the solution was simple instead of looking on internet with useless installation process simply do :

 sudo yum --enablerepo=remi-php72 install php-sodium
  • I recommend to enable the repo permanently, as it provides only PHP, which will avoid more issues with future extensions. See the wizard: https://rpms.remirepo.net/wizard/ – Remi Collet Oct 01 '19 at 09:48
2

For CentOS: 8, PHP 7.3 to install php-sodium, use:

dnf install php-sodium
iFadi
  • 915
  • 2
  • 12
  • 20
0
  1. First check if it's enabled or not.

php -i | grep sodium

  1. If It returns nothing then run the following commands-

sudo yum install libsodium libsodium-devel

sudo pecl install libsodium

Then it told 'You should add "extension=sodium.so" to php.ini'.

  1. Open php.ini file and under "Dynamic Extensions" add

extension=sodium

Follow the step-1 it should return -

sodium
sodium support => enabled
...

DONE! :)

Neha Jaggi
  • 191
  • 2
  • 7