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.