The sodium extension provides high-speed, secure cryptographic operations for PHP applications. As outlined in the Virtuozzo Application Management PHP Extensions documentation, PHP application builds are delivered with a number of embedded modules.
While some essential extensions are enabled out of the box, dynamic extensions are included in the appropriate server builds (stored within the dedicated modules server directory) and can be enabled upon necessity:
-
Apache PHP (
/usr/lib64/php/modules) -
NGINX PHP (
/usr/lib64/php/modules) -
LiteSpeed PHP (
/usr/local/lsws/lsphp/lib64/php/modules)
sodium.so file is missing from the expected modules
directory, adding extension=sodium.so to php.ini
is not enough. Verify the selected PHP stack/version, and escalate the
case to the platform provider support team for validation.
The procedure below serves as a specific example of this generic PHP extension activation flow, demonstrating exactly how to enable the sodium.so module for your environment:
Activate extension
To make the sodium.so extension available for the used PHP module (i.e., engine), it must be enabled within the corresponding configuration file:
php -v. If the versions
differ, verify the selected PHP version/runtime before proceeding.
-
Click the Config button for your app server.
-
Within the opened configuration tab, move to the
php.inifile and open it. -
Search inside the
php.inifile for the directiveextension=sodium.so. If it's already present, do not add a duplicate directive (skip step 4). If it is present as a commented line, uncomment the existing line instead and save the changes. -
Add the
[sodium]section and theextension=sodium.sodirective at the end of thephp.inifile and Save the changes to enable it: -
After all the necessary changes are made, Restart the node to apply the new configuration.
-
To verify that the extension is enabled, execute the command
php -m | grep -i sodiuminside your app server. Expected output:Also, if the status of the extension needs to be confirmed via the web, it can be verified with
phpinfo():