Hi @onyx808,
PASSWORD_ARGON2I support is only available on PHP 7.3 and future versions. You can use PASSWORD_ARGON2I if you have PHP 7.2 or later.
@ayeshrajans Im on PHP Version 7.2.9, setting “define(‘WP_PASSWORD_HASH_ALGO’, PASSWORD_ARGON2I);”
Still gives error.
( ! ) Warning: Use of undefined constant PASSWORD_ARGON2I – assumed ‘PASSWORD_ARGON2I’ (this will throw an Error in a future version of PHP) in /wp-config.php on line 85
I see. It looks like your PHP setup is not compiled with Argon2 support.
Most of the common distros have this enabled, but if you compile PHP yourself, please make sure you have ./configure --with-password-argon2 step to enable Argon2 support.
May I know your OS, whether you compiled PHP yourself, or the repo you used to get PHP binaries from?
You are right, I was testing on my local environment with php 7.2 installed using brew…
for anyone having the same issue see below:
To check whether PHP is compiled with Argon2:
➜ php -r 'print_r(get_defined_constants());' | grep -i argon
[PASSWORD_ARGON2I] => 2
[PASSWORD_ARGON2_DEFAULT_MEMORY_COST] => 1024
[PASSWORD_ARGON2_DEFAULT_TIME_COST] => 2
[PASSWORD_ARGON2_DEFAULT_THREADS] => 2
[SODIUM_CRYPTO_PWHASH_ALG_ARGON2I13] => 1
[SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13] => 2
[SODIUM_CRYPTO_PWHASH_STRPREFIX] => $argon2id$
If you don’t get the above output, either re-compile PHP 7.2+ with the flag –with-password-argon2 or:
Ubuntu
➜ sudo add-apt-repository ppa:ondrej/php
➜ sudo apt-get update
➜ sudo apt-get install php7.2 or php7.3
macOS
➜ brew update
➜ brew install php
Awesome, thanks a lot for this helpful information @onyx808.