使用未定义的常量CRYPT_SHA512 [英] Use of undefined constant CRYPT_SHA512
问题描述
我使用了一个php脚本,它使用php的crypt隐藏密码并使用SHA512,但是当我尝试检查SHA512是否设置时,出现上述错误。当然,我知道为什么我得到这个错误.. PHP是缺少一些依赖。我只是不知道该依赖项是什么。
I use a php script that hashes passwords using php's crypt and uses SHA512, however when I try to check if SHA512 is set I get the above error. Of course I know WHY I get this error.. php is missing some dependency. I just don't know what that dependency is.
任何人都可以告诉我需要安装什么(在Ubuntu服务器上)以便能够在PHP中使用SHA512 ?
Can anyone please tell me what I need to install (on a Ubuntu server) to be able to use SHA512 in PHP ?
谢谢!
Thanks!
推荐答案
在PHP 5.3.2中增加了对SHA-256和SHA-512的支持。如果您使用任何早期版本的PHP,它依赖于系统提供的这些算法的实现,显然您的系统没有。
The php docs say that built-in support for SHA-256 and SHA-512 was added in PHP 5.3.2. If you use any earlier versions of PHP, it relies on implementations of those algorithms provided by your system, which apparently yours does not have.
这篇关于使用未定义的常量CRYPT_SHA512的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!