|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74130 /dev/urandom
Submitted: 2017-02-19 19:12 UTC Modified: 2017-02-19 19:16 UTC
From: bart at jdsoft dot be Assigned:
Status: Duplicate Package: *Encryption and hash functions
PHP Version: 7.0.16 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: bart at jdsoft dot be
New email:
PHP Version: OS:


 [2017-02-19 19:12 UTC] bart at jdsoft dot be
Unable to generate a random value

Test script:
echo "<?php random_bytes(10);" | php   

Actual result:
PHP Fatal error:  Uncaught Exception: Could not gather sufficient random data in -:1                                                                                                                                             
Stack trace:                                                                                                                                                                                                                     
#0 -(1): random_bytes(10)                                                                                                                                                                                                        
#1 {main}                                                                                                                                                                                                                        
  thrown in - on line 1  


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-02-19 19:16 UTC]
-Status: Open +Status: Duplicate
 [2017-02-19 19:16 UTC]
As said in the documentation, this happens on Linux if the system does not support the getrandom(2) syscall. That has been fixed with bug #74105.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Sep 21 08:01:24 2023 UTC