Call to undefined function password_hash() [closed]

六月ゝ 毕业季﹏ 提交于 2019-11-26 16:52:16

问题


I am running php version 5.4.16 on localhost right now, while I am developing my site. I want to use password_hash(), but I keep getting this error:

Fatal error: Call to undefined function password_hash() in /dir/to/file.php on line 123

Why is this happening?

Thanks!


回答1:


The new password_* methods are only available as of PHP 5.5:

http://www.php.net/manual/en/function.password-hash.php

Take a look at this library that provides forward compatibility:

https://github.com/ircmaxell/password_compat

You can use that to get access to the new password_* methods until you are able to run PHP 5.5.



来源:https://stackoverflow.com/questions/20955465/call-to-undefined-function-password-hash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!