gpt4 book ai didi

php - fatal error : Call to undefined function random_bytes()

转载 作者:行者123 更新时间:2023-12-03 02:40:24 27 4
gpt4 key购买 nike

我正在使用 php 5.6.23-0+deb8u1,在我的代码中我想使用函数 random_bytes但我收到此错误:

Fatal error: Call to undefined function random_bytes()

我想知道我是否需要导入某些内容或者该版本的 php 中未包含某些内容,在这种情况下,我该如何替换它?

最佳答案

random_bytes()是随 PHP 7 引入的。

如手册中所述:

Note: Although this function was added to PHP in PHP 7.0, a » userland implementation is available for PHP 5.2 to 5.6, inclusive.

您可以使用该用户态实现作为向后移植:https://github.com/paragonie/random_compat

关于php - fatal error : Call to undefined function random_bytes(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41038612/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com