Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

davy_yg's avatar
Level 27

Call to undefined function Illuminate\Support\random_bytes()

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?

0 likes
4 replies
davy_yg's avatar
Level 27

The web host php version is 5.6 - I just have to wait a few day before I get it updated to php 7.0

Is there any other way to make it work without having to update to php 7?

jezer5ba's avatar

a completely clean install of laravel 5.4 running under php 5.6 is currently broken... steps to reproduce... composer create-project --prefer-dist laravel/laravel test "5.4.*" - visit site.. Call to undefined function Illuminate\Support\random_bytes()

1 like

Please or to participate in this conversation.