我正在开发我的网站时,现在正在本地主机上运行 php 版本 5.4.16。我想用password_hash()
,但我不断收到此错误:
致命错误:调用未定义函数password_hash()/dir/to/file.php在线的123
为什么会发生这种情况?
The new password_*
方法仅从 PHP 5.5 开始可用:
http://www.php.net/manual/en/function.password-hash.php http://www.php.net/manual/en/function.password-hash.php
看看这个提供向前兼容性的库:
https://github.com/ircmaxell/password_compat https://github.com/ircmaxell/password_compat
您可以使用它来访问新的password_*
方法,直到您能够运行 PHP 5.5。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)