在PHP 5.4中调用未定义的函数password_hash()

问题描述:

我试图在我的网站中使用password_hash()函数,但出现错误Call to undefined function password_hash().我在GoDaddy中检查了我的服务器详细信息,而我当前的php版本是5.4.我该如何解决?

I am trying to use the password_hash() function in my website, and I am getting an error Call to undefined function password_hash(). I checked my Server Details in GoDaddy, and my current version of php is 5.4. How can I fix this?

password_hash() 在PHP 5.4中不可用.它是PHP 5.5中的新功能.同时,您可以使用 此兼容包替换 .

兼容性包旁注:

该库需要PHP> = 5.3.7或一个向后移植了$ 2y修订的版本(例如RedHat提供).请注意,不支持Debian的5.3.3版本.

This library requires PHP >= 5.3.7 OR a version that has the $2y fix backported into it (such as RedHat provides). Note that Debian's 5.3.3 version is NOT supported.

对于这些版本未涵盖的版本,请咨询:

For versions not covered by these versions, consult:

  • http://php.net/crypt - (PHP 4, PHP 5)