douchui3933 2016-12-08 11:41
浏览 871
已采纳

致命错误:调用未定义函数random_bytes()[重复]

I'm using php 5.6.23-0+deb8u1 and in my code I want use the function random_bytes but I get this error:

Fatal error: Call to undefined function random_bytes()

I want to know if I need to import something or isn't included in this version of php, in this case, how can I replace it?

</div>
  • 写回答

2条回答 默认 最新

  • doubi7346 2016-12-08 11:44
    关注

    random_bytes() was introduced with PHP 7.

    As stated in the manual:

    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.

    You can use that userland implementation as a backport: https://github.com/paragonie/random_compat

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了