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

sajadsholi's avatar

explain php artisan env:encrypt

I run the php artisan env:encrypt laravel create .env.encrypted file after that I removed the .env file and now laravel can not read anything from .env.encrypted file and throws error like No application encryption key has been specified.

0 likes
3 replies
gych's avatar

Is there a chance that you've changed/generated app key after encrypting the env file?

sajadsholi's avatar

@gych I do this to

php artisan key:generate

php artisan env:encrypt

remove .env

error

Please or to participate in this conversation.