• Resolved Marcos Nobre

    (@onyx808)


    Updated to latests version and added “define( ‘WP_PASSWORD_HASH_ALGO’, PASSWORD_ARGON2ID );” to the wp-config.php, getting the following error.

    ( ! ) Warning: Use of undefined constant PASSWORD_ARGON2ID - assumed 'PASSWORD_ARGON2ID' (this will throw an Error in a future version of PHP) in /wp-config.php on line 85

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ayesh Karunaratne

    (@ayeshrajans)

    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.

    Thread Starter Marcos Nobre

    (@onyx808)

    @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

    Plugin Author Ayesh Karunaratne

    (@ayeshrajans)

    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?

    Thread Starter Marcos Nobre

    (@onyx808)

    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
    Plugin Author Ayesh Karunaratne

    (@ayeshrajans)

    Awesome, thanks a lot for this helpful information @onyx808.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘undefined constant PASSWORD_ARGON2ID’ is closed to new replies.