Travis CI:PHP 7.2 不支持 Argon2i [英] Travis CI: PHP 7.2 don't support Argon2i

查看:25
本文介绍了Travis CI:PHP 7.2 不支持 Argon2i的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Travis CI 项目出错:

I've an error in my project with Travis CI:

不支持 Argon2i 算法.请安装 libsodium 扩展
或升级到 PHP 7.2+.

Argon2i algorithm is not supported. Please install the libsodium extension
or upgrade to PHP 7.2+.

但是,Argon2i 存在于 PHP 7.2 版本中,而 Travis CI 安装了 PHP 7.2 版本:

But, Argon2i is present in the PHP 7.2 version and Travis CI install the PHP 7.2 version:

$ phpenv global 7.2 2>/dev/null

7.2 is not pre-installed; installing
Downloading archive: https://s3.amazonaws.com/travis-php-archives/binaries/ubuntu/14.04/x86_64/php-7.2.tar.bz2
$ curl -s -o archive.tar.bz2 $archive_url && tar xjf archive.tar.bz2 --directory /

$ phpenv global 7.2

$ php --version
PHP 7.2.0 (cli) (built: Dec  2 2017 17:12:55) ( ZTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.2.0, Copyright (c) 1999-2017, by Zend Technologies
    with Xdebug v2.6.0-dev, Copyright (c) 2002-2017, by Derick Rethans

有人有想法吗?

推荐答案

我最近在 Symfony 4 项目中遇到了同样的问题,并发布了一个 issue 在 Travis 的 Github 上.

I faced the same problem recently in a Symfony 4 project and posted an issue on Travis' Github.

然而,问题似乎不是来自 Travis,而是来自 PHP 7.2 默认构建本身.

However, the problem does not seem to come from Travis but from PHP 7.2 default build itself.

引用自己的话:

我在本地使用预配置的 PHP,因此可以确定我只是从源代码编译 PHP 7.2.

I was locally using a pre-configured PHP, so to be sure I just compiled PHP 7.2 from sources.

$ ./php -v
PHP 7.2.0 (cli) (built: Dec  6 2017 15:26:29) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies

然后我尝试使用 ARGON2I 算法,例如官方 文档:

Then I tryed to use the ARGON2I algorithm such as described in official docs:

$ ./php -r 'echo password_hash("test", PASSWORD_ARGON2I) . "\n";'
Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 
'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in Command line code on line 1
Warning: password_hash() expects parameter 2 to be integer, string given in Command line code on line 1

虽然 BCRYPT 没有任何问题:

While not having any problem with BCRYPT:

$ ./php -r 'echo password_hash("test", PASSWORD_BCRYPT) . "\n";'
$2y$10$wsWe3BhyzenVqDs6JV/fPOB0XKh0oTuGdrgLp61MnUPzOUdw4jZey

这很奇怪.我希望这个算法成为默认 PHP 7.2 构建的一部分,就像其他哈希算法一样.文档中似乎没有任何相反的迹象.我会调查.也许我理解错了……但这对我来说似乎是一个错误,因为他们说 这里 PASSWORD_ARGON2I 是 PHP 核心的一部分.

This is strange. I would have expected this algorithm to be part of the default PHP 7.2 build, just as other hash algorithms. And nothing seems to indicate the opposite in the docs. I'll investigate. Maybe I understood something wrong... but this looks like a bug to me, since they say here that PASSWORD_ARGON2I is part of PHP core.


鉴于Sheppard 的评论,看来 7.2 确实没有在其默认版本中实现 PASSWORD_AGRON2I 算法.PHP 必须使用选项 -with-password-argon2 编译,如 https://wiki.php.net/rfc/argon2_password_hash.


In the light of Sheppard's comment, it appears indeed that 7.2 does not implement the PASSWORD_AGRON2Ialgorithm in its default build. PHP has to be compiled with option -with-password-argon2, such as described in https://wiki.php.net/rfc/argon2_password_hash.

这篇关于Travis CI:PHP 7.2 不支持 Argon2i的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆