I'm trying to install the libsodium php extension (https://pecl.php.net/package/libsodium/1.0.6/windows).
When I run php -m
, libsodium shows up in the list.
However, when I go to phpinfo, it is not listed.
I also noticed that apache is giving me the error: PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\xampp\\php\\ext\\php_libsodium.dll' - The specified module could not be found.\r\n in Unknown on line 0
I've checked multiple times and the file is definitely there and matches the correct architecture and thread safety, so I'm at a loss for what else could be causing this.
Any help would be appreciated.
In my experience, you can get the 'Unable to load dynamic library' message for a couple of different reasons:
In your case, given that you indicate a difference between what PHP reports using php -m
and phinfo()
(presumably in a web page), #1 may be the cause. Extensions are looked for in the location specified by the extension_dir
setting in php.ini. If this is a relative path, then it may resolve differently in the context of the web server than it does when running from the command-line.
Try to install libsodium:
verify php and pecl php -v pecl version
If you have php7.X then: sudo pecl install -f libsodium
If you are inside a Docker container: pecl install -f libsodium
Add sodium.so extension to php.ini.
sudo echo "extension = sodium.so" > /etc/php/7.1/mods-available/sodium.ini sudo phpenmod sodium
Verify that extension was installed php -i | grep "sodium"
Try copy xampp\php\libsodium.dll to xampp\apache\bin\libsodium.dll and restart apache. On XAMPP 8.0.5 me help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With