Topic: PHP 7.4 does not seem to be compiled with --with-password-argon2

Hi,

I just upgraded to PHP 7.4 from the Remi repo, and it looks like PHP 7.4, whether installed as a Software Collection or not, is not compiled with --with-password-argon2:

$ php73 -r "echo PASSWORD_ARGON2ID;"
3
$ php74 -r "echo PASSWORD_ARGON2ID;"
PHP Warning:  Use of undefined constant PASSWORD_ARGON2ID - assumed 'PASSWORD_ARGON2ID' (this will throw an Error in a future version of PHP) in Command line code on line 1

Is there any reason why?

Re: PHP 7.4 does not seem to be compiled with --with-password-argon2

you need the ohp-sodium package which provide the argon2 algo

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP 7.4 does not seem to be compiled with --with-password-argon2

Oops, sorry about that! I did check for a missing package, but I was looking for something containing "argon" in the name.
And the fact that php73 (SCL) did work without php73-php-sodium added to the confusion! Why does it work without the sodium package?

Re: PHP 7.4 does not seem to be compiled with --with-password-argon2

PHP 7.3 can only use the libargon2 implementation in standard extension
PHP 7.4 can also use the libsodium implementation in sodium which is better and faster

$ php73 /tmp/foo.php 
PHP version : 7.3.15
Genrerated in 0.143"

$ php74 /tmp/foo.php 
PHP version : 7.4.3
Genrerated in 0,082"

Also in https://github.com/remicollet/remirepo/issues/137

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP 7.4 does not seem to be compiled with --with-password-argon2

Thank you for the explanation.

> PHP 7.4 can also use the libsodium implementation in sodium which is better and faster

Does that mean that PHP 7.4 should also be able to use the standard extension implementation?
Because at the moment it's not!

Re: PHP 7.4 does not seem to be compiled with --with-password-argon2

> Does that mean that PHP 7.4 should also be able to use the standard extension implementation?

Yes, with the proper build option
But IMHO, that doesn't make sense to use it, as the sodium implementation is faster
And this also reduce dependency of PHP (no libargon2)
And libargon2, the referenced implementation is not a real and maintained project

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi