Reputation: 651
I am trying to install the Libsodium PHP extension using PECL, but I have no idea how to get the dll files needed. I want to use it with Wampserver on Windows 7 (64-bit).
Can any one help me?
Upvotes: 16
Views: 31721
Reputation: 24035
Even though in the past apparently more steps were required (see my comment from 2018), today I installed Wamp 3.2.0 64-bit, and when I got an error about libsodium not working, I was able to easily fix it by:
I was pleasantly surprised that is worked!
Additional steps to follow when above two steps are not enough.
Run the cmd php --ini
in terminal, and note the php.ini file path like C:\wamp64\bin\php\php8.1.16\php.ini
Locate and open php.ini file
Find and uncomment extension=sodium
Save the file and restart WAMP.
Upvotes: 9
Reputation: 446
You can also use https://github.com/paragonie/sodium_compat. You can simply use :
composer require paragonie/sodium_compat
Upvotes: 1
Reputation: 506
Here is How I did it.
extension=php_libsodium.dll
You should now get your php_libsodium in the extensions of the php Up and Running. :)
**I didn't notice that, this question is 4 months old. I hope You have solved this.
Upvotes: 14
Reputation: 61
You can download the dll files you need here: http://windows.php.net/downloads/pecl/releases/libsodium/1.0.2/
Select the version that corresponds with your PHP version, compiler and architecture. (this can be checked using phpinfo(); on your machine)
Copy php_libsodium.dll to "ext" directory (C:\PHP\ext)
Copy libsodium.dll to root of PHP directory (C:\PHP)
Add extension=php_libsodium.dll to php.ini
restart apache
This worked on a standalone version of PHP running on Windows 7, I see no reason why this shouldn't work on WAMP or XAMP.
Upvotes: 4
Reputation: 1422
use command prompt :
pecl install libsodium
and go to wamp folder find php.ini in php folder :
append this line: to ini file
extension=libsodium.so
You might be able to achieve this result by running php5enmod libsodium, depending on which webserver you use. Make sure you restart your webserver after installing PECL libsodium
here is good references:
https://paragonie.com/book/pecl-libsodium/read/00-intro.md#installing-libsodium
Upvotes: 3