Cakephp 4 Error: setSalt() must be of the type string, null given

I’m having a problem with my application while trying to migrate it to another computer.

I used cakephp 4 to implement, and the following error message appears when running the application on another computer:

Argument 1 passed to Cake \ Utility \ Security :: setSalt () must be of the string type, null given, called in /…/config/bootstrap.php on line 164

Bootstrap.php line 164 is this:

Security :: setSalt (Configure :: consume (‘Security.salt’));

Why is the argument coming null?

I don’t know what else to do.

Thank’s a lot

In your app.php, is there a value for salt?


‘Security’ => [
‘salt’ => env(‘SECURITY_SALT’),

Is this correct?


Problem solved.
I created the SECURITY_SALT environment variable with a random value, and it worked.

Thanks a lot!!!