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

lararocks's avatar

No supported encrypter found. The cipher and / or key length are invalid.

My site works fine locally and on another shared hosting server. However, I'm trying to move the site to a new host but I got the following error when I moved the files and DB to the new host. Any idea please?

RuntimeException in EncryptionServiceProvider.php line 29: No supported encrypter found. The cipher and / or key length are invalid.

0 likes
6 replies
tykus's avatar

You probably have not set environment variables on the new server; e.g. if you are using .env in production, this doesn't usually get put into version control so wouldn't have been deployed to the new server

EventFellows's avatar

Check what happens in EncryptionServiceProvider.php in line 29 and you have a good hint on where to look.

tykus's avatar

And there is a key set?

Have you run composer install on the new server?

lararocks's avatar
lararocks
OP
Best Answer
Level 1

I installed mcrypt ext and it worked :)

poboy's avatar

Yeah, that mcrypt is a beast. That is actually the reason I left Linux and bought a MacBook Pro. I was tired of spending week after week trying to get mcrypt to play nice with Laravel on Linux Mint 17.3...

Please or to participate in this conversation.