As of PHP 7.2.0 this extension is bundled with PHP. For older PHP versions this extension is available via PECL.
In order to use this extension you must compile PHP with sodium support by using the --with-sodium[=DIR] configure option.
In order to use this extension you have to add
extension=php_sodium.dll
to php.ini.
Information for installing this PECL extension may be found in the manual chapter titled Installation of PECL extensions. Additional information such as new releases, downloads, source files, maintainer information, and a CHANGELOG, can be located here: » https://pecl.php.net/package/libsodium