I'm using Libsodium-PHP, and I'm seeing that the ParagonIE_Sodium_Compat::crypto_pwhash
function produces different results (with the same arguments) when called from the command line versus when called from within the app running on PHP-FPM.
This tutorial says:
Just make sure you install your OS's equivalent of the php7.2-sodium package when you're installing PHP, and all these steps should be taken care of for you.
phpinfo();
shows:
sodium support enabled
sodium compiled version 2.0.12
libsodium headers version 1.0.11
libsodium library version 1.0.11
But for CLI, it shows:
sodium support => enabled
libsodium headers version => 1.0.16
libsodium library version => 1.0.16
My assumption is that the differing Libsodium versions could be what is causing the crypto_pwhash
function to produce different results.
So how can I upgrade the Libsodium extension from 1.0.11 to 1.0.16?
P.S. I know that the CLI version of crypto_pwhash
is producing the output that I want because it matches the output of Libsodium-js (demo fiddle here).