Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Call to undefined function random_bytes() #66

Closed
dev-iwf opened this issue Apr 10, 2018 · 3 comments
Closed

Fatal error: Call to undefined function random_bytes() #66

dev-iwf opened this issue Apr 10, 2018 · 3 comments

Comments

@dev-iwf
Copy link

dev-iwf commented Apr 10, 2018

Hello,

The following error is occurring when I try to run any of the Using Sodium Compat examples in the README.

Fatal error: Call to undefined function random_bytes() in /path/to/sodium_compat-1.6.1/src/Core/Ed25519.php on line 24

As I understand it, random_bytes() is only available in PHP >= 7.
Is there a reason for this error or am I missing something?

I managed to circumvent the error by using Random-Compat (https://github.com/paragonie/random_compat), but ideally I'd want to avoid this.

@Furgas
Copy link
Contributor

Furgas commented Apr 10, 2018

Random_compact is required for this library, as pointed in composer.json. Running composer install should install random_compat for you.

@dev-iwf
Copy link
Author

dev-iwf commented Apr 10, 2018

Thank you. I've missed that since I looked at the Install From Source

@dev-iwf dev-iwf closed this as completed Apr 10, 2018
@Furgas
Copy link
Contributor

Furgas commented Apr 10, 2018

Yeah, I guess that section is somewhat misleading. Either it should mention that you need to have/install random_compact separately, or the tarball should already include that library, just like PHAR release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants