3

I'm having really hard trouble installing libsodium on my local server (WAMP64).

I used this guide and many others, but still no luck.

I successfully installed PEAR but I can't use it to install the PHP wrapper of libsodium. Can someone post a little guide step by step to help me?

ERROR: The DSP libsodium.dsp does not exist.

I would appreciate help installing Halite, wich needs libsodium, because maybe it will be my next step.

Thank you everyone.

rrauenza
  • 6,285
  • 4
  • 32
  • 57
Andrea
  • 103
  • 1
  • 1
  • 13
  • Maybe related, but unanswered: http://stackoverflow.com/questions/33846389/error-the-dsp-mongodb-dsp-does-not-exist – rrauenza Jun 15 '16 at 17:35
  • 1
    In the guide you posted, did you follow the instructions immediately following *"On Windows, download the appropriate zip file for your version of PHP and then follow these three steps"*? – rrauenza Jun 15 '16 at 17:38
  • Yes, I did follow those steps – Andrea Jun 15 '16 at 22:48

3 Answers3

6

On Windows, download the appropriate zip file for your version of PHP and then follow these three steps. (I used 1.0.6 for PHP 7.0 in my testing).

  1. Copy libsodium.dll to the System32 Folder or the same directory as php.exe. Also copy it to the apache/bin/ folder (for me that was C:\xampp\apache\bin).
  2. Copy php_libsodium.dll to the PHP extension directory (C:\xampp\php\ext\ for me)
  3. Add extension=php_libsodium.dll to your php.ini file.

The bolded part in step 1 is what I was missing. As soon as I placed the dll in that folder and restarted Apache, everything started working.

You can create a new php file with this code to verify it is working properly:

<?php
var_dump([
    \Sodium\library_version_major(),
    \Sodium\library_version_minor(),
    \Sodium\version_string()
]);
Kenny Johnson
  • 764
  • 1
  • 9
  • 25
1

Do Not Try To Install Pecl Extensions On Windows With Pear/Pecl. It Will Not Work.

Rather use pre-compiled .dll file.


The guide page even says so:

Installing Libsodium and the PHP Extension on Windows

On Windows, download the appropriate zip file for your version of PHP and then follow these three steps.

Community
  • 1
  • 1
cweiske
  • 30,033
  • 14
  • 133
  • 194
  • In the guide it says I must do it with Pecl, I don't know about pre-compiled .dll file of Libsodium or other ways :( – Andrea Jun 16 '16 at 12:52
  • @Andrea, the section in that guide on Installing Libsodium and the PHP Extension on Windows does not refer to pecl at all, so if you follow those steps [again] and ignore references to pecl outside that section it should just work. I can understand your confusion as the documentation doesn't clearly delineate the sections... – kguest Jun 16 '16 at 21:17
  • Even ignoring the pecl part I did everything and it doesn't work :( I'm missing something but I don't know what... – Andrea Jun 16 '16 at 23:40
0
  1. goto WAMPSERVER and install listed PHP
  2. Enable sodium and check in 'Show PHP loaded Extensions' it will get loaded sodium enable pic
  1. check-in PHP module if sodium is available or not with the following command

    cmd> php -m cmd> php --ri sodium

  2. if sodium is not listed then go to your /php/php.ini and search for ';extension=sodium' and remove ';' you will be good to go

Mudassir
  • 398
  • 5
  • 6