random_bytes() was introduced with PHP 7. So first check your php version.
You can use random_bytes() as a backport.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I receive this error message:
FatalErrorException in Str.php line 243: Call to undefined function Illuminate\Support\random_bytes()
public static function randomBytes($length = 16) { return random_bytes($length); }
line 243: return random_bytes($length);
I do not understand what's wrong since a working version laravel offline that extract online. It does not work online though. I wonder why?
random_bytes() was introduced with PHP 7. So first check your php version.
You can use random_bytes() as a backport.
Please or to participate in this conversation.