I have a Laravel application. I have tested the application on my test server. Now I want to have that on my production servers. My question is do I need to generate APP_KEY for each production server? by doing a php artisan key:generate
each time I upload to a new server? or can I use the same one I already have in my .env file?
Asked
Active
Viewed 1,478 times
2

Ranga Lakshitha
- 286
- 2
- 14
-
You don't need to generate for each server – Pankaj Makwana Sep 13 '17 at 12:20
-
This will help you. https://stackoverflow.com/questions/33370134/when-to-generate-a-new-application-key-in-laravel – sadakat Sep 13 '17 at 12:23
-
Thanks Pankaj & andsadekat. I am not cloning, I FTP files to servers. So should not have error coz of the key. I get an error could be something else. Will check that. thanks again. – Ranga Lakshitha Sep 13 '17 at 13:50
1 Answers
0
The .env file is not committed when we change our server you have to copy the example.env file to .env file and then apply the command
php artisan key:generate
i hope its will work :)

Harish Patel
- 84
- 8