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

gillaraz's avatar

There is no suitable CSPRNG installed on your system

Hello Guys,

I'm trying to upload from local to Remote Server by Git. My website is on Laravel 5.2. On local, everything works fine on Wamp, but when I upload to remote server for the first time. This error keeps appearing.

Exception in random.php line 185: There is no suitable CSPRNG installed on your system

I have been fixing for many hours and have no clue. My remote server is VPS Centos 6.7 with PHP 5.6, Open SSL and "paragonie/random_compat": "^1.3" installed. I believe this error comes from paragonie package according to https://github.com/paragonie/random_compat/blob/master/lib/random.php

  • In order of preference: * 1. Use libsodium if available. * 2. fread() /dev/urandom if available (never on Windows) * 3. mcrypt_create_iv($bytes, MCRYPT_DEV_URANDOM) * 4. COM('CAPICOM.Utilities.1')->GetRandom() * 5. openssl_random_pseudo_bytes() (absolute last resort)

I'm quite sure that openssl is enable and openssl_random_pseudo_bytes() could be executed.

0 likes
9 replies
Apfelfrisch's avatar

Same error hier after updating an existing System. Setup is Ubuntu 14.04 with paragonie/random_compat "~1.1"

Update: Ok the random.php file from yesterday works fine, looks like we have an regression.

janhenkes's avatar
Level 1

I had the same issue. "paragonie/random_compat" was a dependency of one of my dependencies and was updated automatically to version 1.3.0 which caused the issue. I solved it by adding "paragonie/random_compat": "1.2.*" to my projects composer dependencies and updating composer.

3 likes
smoothlikejazz's avatar

Ive just ran an application composer update deployment on my Centos Server as well, running into the same Issue :(

janhenkes's avatar

@smoothlikejazz Can you try what I did? My composer.json now looks like:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
            "php": ">=5.4.0",
            "laravel/framework": "5.0.*",
        "guzzlehttp/guzzle": "~4.0",
            "jenssegers/date": "3.*",
            "illuminate/html": "5.0.*",
            "doctrine/dbal": "dev-master",
            "paragonie/random_compat": "1.2.*",
            "weblabnl/breadcrumb": "dev-master"
    },
    ......
}
1 like
VictorZZZ's avatar

I have Laravel 5.3 version. And i had the same issue. When i added "paragonie/random_compat". It was updated automatically to version 2.0. But the issue not disappeared.

Problem was solved by adding "paragonie/random_compat":"1.4.*" update

1 like

Please or to participate in this conversation.