Search code examples
phplaravel-5argon2-ffi

undefined constant PASSWORD_ARGON2I Laravel


I have been having difficulty using the new password hashing laravel just introduce (argon) in laravel. I got this error message

Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' 
(this will throw an Error in a future version of PHP) 
{"exception":"[object] (ErrorException(code: 0): 
Use of undefined constant PASSWORD_ARGON2I - 
assumed 'PASSWORD_ARGON2I' (this will throw an Error 
in a future version of PHP)

And my type of php version is what argon recommended, am working from a mac system

PHP 7.2.0 (cli) (built: Dec 11 2017 16:00:14) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies

Please help


Solution

  • Most likely cause is PHP wasn't compiled with --with-password-argon2.

    Reference: PHP Warning: Use of undefined constant PASSWORD_ARGON2ID when using password_hash() in php 7.3