No Application Encryption Key Has Been Specified
I'm new to Laravel and I'm trying to use the Artisan command...
php artisan serve
It displays...
Laravel development server started: http://127.0.0.1:8000
However, it won't automatically launch and when I manually enter http://127.0.0.1:8000 it shows this error:
RuntimeException No application encryption key has been specified.
Any ideas? I'm using Laravel framework 5.5-dev.
php laravel laravel-5 laravel-5.5 artisan
add a comment |
I'm new to Laravel and I'm trying to use the Artisan command...
php artisan serve
It displays...
Laravel development server started: http://127.0.0.1:8000
However, it won't automatically launch and when I manually enter http://127.0.0.1:8000 it shows this error:
RuntimeException No application encryption key has been specified.
Any ideas? I'm using Laravel framework 5.5-dev.
php laravel laravel-5 laravel-5.5 artisan
or if your .env file needs to be changed ref: stackoverflow.com/questions/36276767/…
– Nameishi
Aug 12 '17 at 23:20
2
The answers below are correct: however, if you first run "php artisan serve" and have an active web server session you will need to restart the server (control-c in the terminal to stop) to get the change to take effect after you add the key to your .env file.
– Chris Adams
Oct 24 '17 at 19:51
add a comment |
I'm new to Laravel and I'm trying to use the Artisan command...
php artisan serve
It displays...
Laravel development server started: http://127.0.0.1:8000
However, it won't automatically launch and when I manually enter http://127.0.0.1:8000 it shows this error:
RuntimeException No application encryption key has been specified.
Any ideas? I'm using Laravel framework 5.5-dev.
php laravel laravel-5 laravel-5.5 artisan
I'm new to Laravel and I'm trying to use the Artisan command...
php artisan serve
It displays...
Laravel development server started: http://127.0.0.1:8000
However, it won't automatically launch and when I manually enter http://127.0.0.1:8000 it shows this error:
RuntimeException No application encryption key has been specified.
Any ideas? I'm using Laravel framework 5.5-dev.
php laravel laravel-5 laravel-5.5 artisan
php laravel laravel-5 laravel-5.5 artisan
edited Nov 21 '18 at 5:49
Karl Hill
2,55412042
2,55412042
asked Jun 30 '17 at 6:06
Carlos FCarlos F
9322715
9322715
or if your .env file needs to be changed ref: stackoverflow.com/questions/36276767/…
– Nameishi
Aug 12 '17 at 23:20
2
The answers below are correct: however, if you first run "php artisan serve" and have an active web server session you will need to restart the server (control-c in the terminal to stop) to get the change to take effect after you add the key to your .env file.
– Chris Adams
Oct 24 '17 at 19:51
add a comment |
or if your .env file needs to be changed ref: stackoverflow.com/questions/36276767/…
– Nameishi
Aug 12 '17 at 23:20
2
The answers below are correct: however, if you first run "php artisan serve" and have an active web server session you will need to restart the server (control-c in the terminal to stop) to get the change to take effect after you add the key to your .env file.
– Chris Adams
Oct 24 '17 at 19:51
or if your .env file needs to be changed ref: stackoverflow.com/questions/36276767/…
– Nameishi
Aug 12 '17 at 23:20
or if your .env file needs to be changed ref: stackoverflow.com/questions/36276767/…
– Nameishi
Aug 12 '17 at 23:20
2
2
The answers below are correct: however, if you first run "php artisan serve" and have an active web server session you will need to restart the server (control-c in the terminal to stop) to get the change to take effect after you add the key to your .env file.
– Chris Adams
Oct 24 '17 at 19:51
The answers below are correct: however, if you first run "php artisan serve" and have an active web server session you will need to restart the server (control-c in the terminal to stop) to get the change to take effect after you add the key to your .env file.
– Chris Adams
Oct 24 '17 at 19:51
add a comment |
11 Answers
11
active
oldest
votes
From Encryption - Laravel - The PHP Framework For Web Artisans:
"Before using Laravel's encrypter, you must set a key option in your
config/app.php configuration file. You should use the
php artisan key:generate
command to generate this key"
I found that using this complex internet query in google.com:
"laravel add encrption key" (Yes, it worked even with the typo!)
17
I googled the whole error and nothing apeared, just googled set encriptyon key and found out. Feel like a fool. Thanks. For anyone who arrives here just run:php artisan key:generate
– Carlos F
Jun 30 '17 at 6:11
Im sorry so are you putting php artisan key:generate in the terminal? because I get an ErrorException
– Nameishi
Aug 12 '17 at 22:57
1
For anyone else that ran into my issue input this into the terminal cp .env.example .env php artisan key:generate
– Nameishi
Aug 12 '17 at 23:15
4
php artisan key:generate
does not even work for me. Gives me the same error No application encryption key has been specified, please any solution?
– Oniya Daniel
Nov 4 '17 at 8:39
4
This worked for me, but I first had to rename the file .env.example to .env for this to work, otherwise I was getting ".env: no such file" error.
– Webomatik
Nov 27 '17 at 15:11
|
show 5 more comments
In my case, I also needed to reset the cached config files:
php artisan key:generate
php artisan config:cache
2
I always come to see this answer after I forget to clear the cache
– vijayrana
Aug 21 '18 at 16:40
1
This was missing from all the answers. Thanks so very much! :)
– Aman Alam
Aug 28 '18 at 8:52
add a comment |
Run the command php artisan key:generate
it will generate Application Key for your application. You can find the application key(APP_KEY) in .env
file.
I think you should update the answer . The file name is .env .
– Madhab452
Dec 12 '17 at 7:23
@Madhab452 thanks, I did fix it.
– skm
Dec 12 '17 at 11:31
add a comment |
simply run php artisan key:generate
1
Yes but many hosting server do not have command line access then how to do?
– Dhiraj
Nov 13 '17 at 8:50
1
a majority support ssh connection. from your terminal run ssh yourusername@server_ip
– D J
Oct 17 '18 at 12:29
add a comment |
I actually had to add a .env file to my project and then copy the contents of .env.example so that the key:generate
would work. Not sure why a .env file was not created when I started the project.
1
It might depend on how you installed Laravel ... "In a fresh Laravel installation, the root directory of your application will contain a.env.example
file. If you install Laravel via Composer, this file will automatically be renamed to.env
. Otherwise, you should rename the file manually." -#Environment Configuration
– Sᴀᴍ Onᴇᴌᴀ
Sep 11 '17 at 16:01
also, if you cloned the project from a repo where the .env file was likely in .gitignore, then you would neeed to create it as well. From the Laravel docs: 'Your .env file should not be committed to your application's source control, since each developer / server using your application could require a different environment configuration'
– Sami El Maameri
Jun 17 '18 at 6:08
I also found that if you download it from the cloud (I'm using windows) i.e. google-drive, sky-drive etc. the .env, .env.example files are named _env, _env.example etc. In that case I renamed the files accordingly and then just ran 'php artisan key:generate'.
– Timothy Kruger
Jun 18 '18 at 7:49
add a comment |
Copy
.env.example
to.env
:
cp -a .env.example .env
Generate a key:
php artisan key:generate
Only then run:
php artisan serve
add a comment |
cp .env.example .env
if there is no .env file present.
php artisan key:generate
command works for me. It generates the encryption key
clear the cache usingphp artisan config:cache
command after the above steps.
– Sabyasachi Ghosh
Jan 14 at 10:08
add a comment |
php artisan key:generate
php artisan config:cache
worked for me, but it had to be done in a command prompt on Windows.
Doing it inside the terminal in PHPStorm didn't worked.
add a comment |
A common issue you might experience when working on a Laravel application is the exception:
RuntimeException No application encryption key has been specified.
You'll often run into this when you pull down an existing Laravel application, where you copy the .env.example
file to .env
but don't set a value for the APP_KEY
variable.
At the command line, issue the following Artisan command to generate a key:
php artisan key:generate
This will generate a random key for APP_KEY
, After completion of .env
edit please enter this command in your terminal for clear cache:php artisan config:cache
Also, you have to restart the server now you will not get to see this error message.
add a comment |
Okay, I'll write another instruction, because didn't find the clear answer here. So if you faced such problems, follow this:
- Rename or copy/rename .env.example file in the root of your project to .env.
You should not just create empty .env file, but fill it with
content of .env.example.
- In the terminal go to the project root directory(not public folder) and run
php artisan key:generate
- If everything is okay, the response in the terminal should look like this
Application key [base64:wbvPP9pBOwifnwu84BeKAVzmwM4TLvcVFowLcPAi6nA=]
set successfully.
- Now just copy key itself and paste it in your .env file as the value to APP_KEY. Result line should look like this:
APP_KEY=base64:wbvPP9pBOwifnwu84BeKAVzmwM4TLvcVFowLcPAi6nA=
- In terminal run
php artisan config:cache
That's it.
Sophp artisan key:generate
didn't automatically add the key to your .env file?
– Ross Wilson
Jul 25 '18 at 12:39
No, in my case.
– Dmitry Gordienko
Jul 25 '18 at 12:48
add a comment |
You can generate Application Encryption Key using this command:
php artisan key:generate
Then, create a cache file for faster configuration loading using this command:
php artisan config:cache
Or, serve the application on the PHP development server using this command:
php artisan serve
That's it!
add a comment |
11 Answers
11
active
oldest
votes
11 Answers
11
active
oldest
votes
active
oldest
votes
active
oldest
votes
From Encryption - Laravel - The PHP Framework For Web Artisans:
"Before using Laravel's encrypter, you must set a key option in your
config/app.php configuration file. You should use the
php artisan key:generate
command to generate this key"
I found that using this complex internet query in google.com:
"laravel add encrption key" (Yes, it worked even with the typo!)
17
I googled the whole error and nothing apeared, just googled set encriptyon key and found out. Feel like a fool. Thanks. For anyone who arrives here just run:php artisan key:generate
– Carlos F
Jun 30 '17 at 6:11
Im sorry so are you putting php artisan key:generate in the terminal? because I get an ErrorException
– Nameishi
Aug 12 '17 at 22:57
1
For anyone else that ran into my issue input this into the terminal cp .env.example .env php artisan key:generate
– Nameishi
Aug 12 '17 at 23:15
4
php artisan key:generate
does not even work for me. Gives me the same error No application encryption key has been specified, please any solution?
– Oniya Daniel
Nov 4 '17 at 8:39
4
This worked for me, but I first had to rename the file .env.example to .env for this to work, otherwise I was getting ".env: no such file" error.
– Webomatik
Nov 27 '17 at 15:11
|
show 5 more comments
From Encryption - Laravel - The PHP Framework For Web Artisans:
"Before using Laravel's encrypter, you must set a key option in your
config/app.php configuration file. You should use the
php artisan key:generate
command to generate this key"
I found that using this complex internet query in google.com:
"laravel add encrption key" (Yes, it worked even with the typo!)
17
I googled the whole error and nothing apeared, just googled set encriptyon key and found out. Feel like a fool. Thanks. For anyone who arrives here just run:php artisan key:generate
– Carlos F
Jun 30 '17 at 6:11
Im sorry so are you putting php artisan key:generate in the terminal? because I get an ErrorException
– Nameishi
Aug 12 '17 at 22:57
1
For anyone else that ran into my issue input this into the terminal cp .env.example .env php artisan key:generate
– Nameishi
Aug 12 '17 at 23:15
4
php artisan key:generate
does not even work for me. Gives me the same error No application encryption key has been specified, please any solution?
– Oniya Daniel
Nov 4 '17 at 8:39
4
This worked for me, but I first had to rename the file .env.example to .env for this to work, otherwise I was getting ".env: no such file" error.
– Webomatik
Nov 27 '17 at 15:11
|
show 5 more comments
From Encryption - Laravel - The PHP Framework For Web Artisans:
"Before using Laravel's encrypter, you must set a key option in your
config/app.php configuration file. You should use the
php artisan key:generate
command to generate this key"
I found that using this complex internet query in google.com:
"laravel add encrption key" (Yes, it worked even with the typo!)
From Encryption - Laravel - The PHP Framework For Web Artisans:
"Before using Laravel's encrypter, you must set a key option in your
config/app.php configuration file. You should use the
php artisan key:generate
command to generate this key"
I found that using this complex internet query in google.com:
"laravel add encrption key" (Yes, it worked even with the typo!)
edited Aug 9 '18 at 8:17
answered Jun 30 '17 at 6:08
AmarnasanAmarnasan
7,70832032
7,70832032
17
I googled the whole error and nothing apeared, just googled set encriptyon key and found out. Feel like a fool. Thanks. For anyone who arrives here just run:php artisan key:generate
– Carlos F
Jun 30 '17 at 6:11
Im sorry so are you putting php artisan key:generate in the terminal? because I get an ErrorException
– Nameishi
Aug 12 '17 at 22:57
1
For anyone else that ran into my issue input this into the terminal cp .env.example .env php artisan key:generate
– Nameishi
Aug 12 '17 at 23:15
4
php artisan key:generate
does not even work for me. Gives me the same error No application encryption key has been specified, please any solution?
– Oniya Daniel
Nov 4 '17 at 8:39
4
This worked for me, but I first had to rename the file .env.example to .env for this to work, otherwise I was getting ".env: no such file" error.
– Webomatik
Nov 27 '17 at 15:11
|
show 5 more comments
17
I googled the whole error and nothing apeared, just googled set encriptyon key and found out. Feel like a fool. Thanks. For anyone who arrives here just run:php artisan key:generate
– Carlos F
Jun 30 '17 at 6:11
Im sorry so are you putting php artisan key:generate in the terminal? because I get an ErrorException
– Nameishi
Aug 12 '17 at 22:57
1
For anyone else that ran into my issue input this into the terminal cp .env.example .env php artisan key:generate
– Nameishi
Aug 12 '17 at 23:15
4
php artisan key:generate
does not even work for me. Gives me the same error No application encryption key has been specified, please any solution?
– Oniya Daniel
Nov 4 '17 at 8:39
4
This worked for me, but I first had to rename the file .env.example to .env for this to work, otherwise I was getting ".env: no such file" error.
– Webomatik
Nov 27 '17 at 15:11
17
17
I googled the whole error and nothing apeared, just googled set encriptyon key and found out. Feel like a fool. Thanks. For anyone who arrives here just run:
php artisan key:generate
– Carlos F
Jun 30 '17 at 6:11
I googled the whole error and nothing apeared, just googled set encriptyon key and found out. Feel like a fool. Thanks. For anyone who arrives here just run:
php artisan key:generate
– Carlos F
Jun 30 '17 at 6:11
Im sorry so are you putting php artisan key:generate in the terminal? because I get an ErrorException
– Nameishi
Aug 12 '17 at 22:57
Im sorry so are you putting php artisan key:generate in the terminal? because I get an ErrorException
– Nameishi
Aug 12 '17 at 22:57
1
1
For anyone else that ran into my issue input this into the terminal cp .env.example .env php artisan key:generate
– Nameishi
Aug 12 '17 at 23:15
For anyone else that ran into my issue input this into the terminal cp .env.example .env php artisan key:generate
– Nameishi
Aug 12 '17 at 23:15
4
4
php artisan key:generate
does not even work for me. Gives me the same error No application encryption key has been specified, please any solution?– Oniya Daniel
Nov 4 '17 at 8:39
php artisan key:generate
does not even work for me. Gives me the same error No application encryption key has been specified, please any solution?– Oniya Daniel
Nov 4 '17 at 8:39
4
4
This worked for me, but I first had to rename the file .env.example to .env for this to work, otherwise I was getting ".env: no such file" error.
– Webomatik
Nov 27 '17 at 15:11
This worked for me, but I first had to rename the file .env.example to .env for this to work, otherwise I was getting ".env: no such file" error.
– Webomatik
Nov 27 '17 at 15:11
|
show 5 more comments
In my case, I also needed to reset the cached config files:
php artisan key:generate
php artisan config:cache
2
I always come to see this answer after I forget to clear the cache
– vijayrana
Aug 21 '18 at 16:40
1
This was missing from all the answers. Thanks so very much! :)
– Aman Alam
Aug 28 '18 at 8:52
add a comment |
In my case, I also needed to reset the cached config files:
php artisan key:generate
php artisan config:cache
2
I always come to see this answer after I forget to clear the cache
– vijayrana
Aug 21 '18 at 16:40
1
This was missing from all the answers. Thanks so very much! :)
– Aman Alam
Aug 28 '18 at 8:52
add a comment |
In my case, I also needed to reset the cached config files:
php artisan key:generate
php artisan config:cache
In my case, I also needed to reset the cached config files:
php artisan key:generate
php artisan config:cache
answered Jan 17 '18 at 14:20
Leonid DashkoLeonid Dashko
746611
746611
2
I always come to see this answer after I forget to clear the cache
– vijayrana
Aug 21 '18 at 16:40
1
This was missing from all the answers. Thanks so very much! :)
– Aman Alam
Aug 28 '18 at 8:52
add a comment |
2
I always come to see this answer after I forget to clear the cache
– vijayrana
Aug 21 '18 at 16:40
1
This was missing from all the answers. Thanks so very much! :)
– Aman Alam
Aug 28 '18 at 8:52
2
2
I always come to see this answer after I forget to clear the cache
– vijayrana
Aug 21 '18 at 16:40
I always come to see this answer after I forget to clear the cache
– vijayrana
Aug 21 '18 at 16:40
1
1
This was missing from all the answers. Thanks so very much! :)
– Aman Alam
Aug 28 '18 at 8:52
This was missing from all the answers. Thanks so very much! :)
– Aman Alam
Aug 28 '18 at 8:52
add a comment |
Run the command php artisan key:generate
it will generate Application Key for your application. You can find the application key(APP_KEY) in .env
file.
I think you should update the answer . The file name is .env .
– Madhab452
Dec 12 '17 at 7:23
@Madhab452 thanks, I did fix it.
– skm
Dec 12 '17 at 11:31
add a comment |
Run the command php artisan key:generate
it will generate Application Key for your application. You can find the application key(APP_KEY) in .env
file.
I think you should update the answer . The file name is .env .
– Madhab452
Dec 12 '17 at 7:23
@Madhab452 thanks, I did fix it.
– skm
Dec 12 '17 at 11:31
add a comment |
Run the command php artisan key:generate
it will generate Application Key for your application. You can find the application key(APP_KEY) in .env
file.
Run the command php artisan key:generate
it will generate Application Key for your application. You can find the application key(APP_KEY) in .env
file.
edited Dec 12 '17 at 11:30
answered Jun 30 '17 at 6:15
skmskm
810622
810622
I think you should update the answer . The file name is .env .
– Madhab452
Dec 12 '17 at 7:23
@Madhab452 thanks, I did fix it.
– skm
Dec 12 '17 at 11:31
add a comment |
I think you should update the answer . The file name is .env .
– Madhab452
Dec 12 '17 at 7:23
@Madhab452 thanks, I did fix it.
– skm
Dec 12 '17 at 11:31
I think you should update the answer . The file name is .env .
– Madhab452
Dec 12 '17 at 7:23
I think you should update the answer . The file name is .env .
– Madhab452
Dec 12 '17 at 7:23
@Madhab452 thanks, I did fix it.
– skm
Dec 12 '17 at 11:31
@Madhab452 thanks, I did fix it.
– skm
Dec 12 '17 at 11:31
add a comment |
simply run php artisan key:generate
1
Yes but many hosting server do not have command line access then how to do?
– Dhiraj
Nov 13 '17 at 8:50
1
a majority support ssh connection. from your terminal run ssh yourusername@server_ip
– D J
Oct 17 '18 at 12:29
add a comment |
simply run php artisan key:generate
1
Yes but many hosting server do not have command line access then how to do?
– Dhiraj
Nov 13 '17 at 8:50
1
a majority support ssh connection. from your terminal run ssh yourusername@server_ip
– D J
Oct 17 '18 at 12:29
add a comment |
simply run php artisan key:generate
simply run php artisan key:generate
answered Sep 12 '17 at 6:18
D JD J
18414
18414
1
Yes but many hosting server do not have command line access then how to do?
– Dhiraj
Nov 13 '17 at 8:50
1
a majority support ssh connection. from your terminal run ssh yourusername@server_ip
– D J
Oct 17 '18 at 12:29
add a comment |
1
Yes but many hosting server do not have command line access then how to do?
– Dhiraj
Nov 13 '17 at 8:50
1
a majority support ssh connection. from your terminal run ssh yourusername@server_ip
– D J
Oct 17 '18 at 12:29
1
1
Yes but many hosting server do not have command line access then how to do?
– Dhiraj
Nov 13 '17 at 8:50
Yes but many hosting server do not have command line access then how to do?
– Dhiraj
Nov 13 '17 at 8:50
1
1
a majority support ssh connection. from your terminal run ssh yourusername@server_ip
– D J
Oct 17 '18 at 12:29
a majority support ssh connection. from your terminal run ssh yourusername@server_ip
– D J
Oct 17 '18 at 12:29
add a comment |
I actually had to add a .env file to my project and then copy the contents of .env.example so that the key:generate
would work. Not sure why a .env file was not created when I started the project.
1
It might depend on how you installed Laravel ... "In a fresh Laravel installation, the root directory of your application will contain a.env.example
file. If you install Laravel via Composer, this file will automatically be renamed to.env
. Otherwise, you should rename the file manually." -#Environment Configuration
– Sᴀᴍ Onᴇᴌᴀ
Sep 11 '17 at 16:01
also, if you cloned the project from a repo where the .env file was likely in .gitignore, then you would neeed to create it as well. From the Laravel docs: 'Your .env file should not be committed to your application's source control, since each developer / server using your application could require a different environment configuration'
– Sami El Maameri
Jun 17 '18 at 6:08
I also found that if you download it from the cloud (I'm using windows) i.e. google-drive, sky-drive etc. the .env, .env.example files are named _env, _env.example etc. In that case I renamed the files accordingly and then just ran 'php artisan key:generate'.
– Timothy Kruger
Jun 18 '18 at 7:49
add a comment |
I actually had to add a .env file to my project and then copy the contents of .env.example so that the key:generate
would work. Not sure why a .env file was not created when I started the project.
1
It might depend on how you installed Laravel ... "In a fresh Laravel installation, the root directory of your application will contain a.env.example
file. If you install Laravel via Composer, this file will automatically be renamed to.env
. Otherwise, you should rename the file manually." -#Environment Configuration
– Sᴀᴍ Onᴇᴌᴀ
Sep 11 '17 at 16:01
also, if you cloned the project from a repo where the .env file was likely in .gitignore, then you would neeed to create it as well. From the Laravel docs: 'Your .env file should not be committed to your application's source control, since each developer / server using your application could require a different environment configuration'
– Sami El Maameri
Jun 17 '18 at 6:08
I also found that if you download it from the cloud (I'm using windows) i.e. google-drive, sky-drive etc. the .env, .env.example files are named _env, _env.example etc. In that case I renamed the files accordingly and then just ran 'php artisan key:generate'.
– Timothy Kruger
Jun 18 '18 at 7:49
add a comment |
I actually had to add a .env file to my project and then copy the contents of .env.example so that the key:generate
would work. Not sure why a .env file was not created when I started the project.
I actually had to add a .env file to my project and then copy the contents of .env.example so that the key:generate
would work. Not sure why a .env file was not created when I started the project.
edited Sep 11 '17 at 15:57
Sᴀᴍ Onᴇᴌᴀ
6,56182142
6,56182142
answered Sep 11 '17 at 15:35
Craig KollrossCraig Kollross
14112
14112
1
It might depend on how you installed Laravel ... "In a fresh Laravel installation, the root directory of your application will contain a.env.example
file. If you install Laravel via Composer, this file will automatically be renamed to.env
. Otherwise, you should rename the file manually." -#Environment Configuration
– Sᴀᴍ Onᴇᴌᴀ
Sep 11 '17 at 16:01
also, if you cloned the project from a repo where the .env file was likely in .gitignore, then you would neeed to create it as well. From the Laravel docs: 'Your .env file should not be committed to your application's source control, since each developer / server using your application could require a different environment configuration'
– Sami El Maameri
Jun 17 '18 at 6:08
I also found that if you download it from the cloud (I'm using windows) i.e. google-drive, sky-drive etc. the .env, .env.example files are named _env, _env.example etc. In that case I renamed the files accordingly and then just ran 'php artisan key:generate'.
– Timothy Kruger
Jun 18 '18 at 7:49
add a comment |
1
It might depend on how you installed Laravel ... "In a fresh Laravel installation, the root directory of your application will contain a.env.example
file. If you install Laravel via Composer, this file will automatically be renamed to.env
. Otherwise, you should rename the file manually." -#Environment Configuration
– Sᴀᴍ Onᴇᴌᴀ
Sep 11 '17 at 16:01
also, if you cloned the project from a repo where the .env file was likely in .gitignore, then you would neeed to create it as well. From the Laravel docs: 'Your .env file should not be committed to your application's source control, since each developer / server using your application could require a different environment configuration'
– Sami El Maameri
Jun 17 '18 at 6:08
I also found that if you download it from the cloud (I'm using windows) i.e. google-drive, sky-drive etc. the .env, .env.example files are named _env, _env.example etc. In that case I renamed the files accordingly and then just ran 'php artisan key:generate'.
– Timothy Kruger
Jun 18 '18 at 7:49
1
1
It might depend on how you installed Laravel ... "In a fresh Laravel installation, the root directory of your application will contain a
.env.example
file. If you install Laravel via Composer, this file will automatically be renamed to .env
. Otherwise, you should rename the file manually." -#Environment Configuration– Sᴀᴍ Onᴇᴌᴀ
Sep 11 '17 at 16:01
It might depend on how you installed Laravel ... "In a fresh Laravel installation, the root directory of your application will contain a
.env.example
file. If you install Laravel via Composer, this file will automatically be renamed to .env
. Otherwise, you should rename the file manually." -#Environment Configuration– Sᴀᴍ Onᴇᴌᴀ
Sep 11 '17 at 16:01
also, if you cloned the project from a repo where the .env file was likely in .gitignore, then you would neeed to create it as well. From the Laravel docs: 'Your .env file should not be committed to your application's source control, since each developer / server using your application could require a different environment configuration'
– Sami El Maameri
Jun 17 '18 at 6:08
also, if you cloned the project from a repo where the .env file was likely in .gitignore, then you would neeed to create it as well. From the Laravel docs: 'Your .env file should not be committed to your application's source control, since each developer / server using your application could require a different environment configuration'
– Sami El Maameri
Jun 17 '18 at 6:08
I also found that if you download it from the cloud (I'm using windows) i.e. google-drive, sky-drive etc. the .env, .env.example files are named _env, _env.example etc. In that case I renamed the files accordingly and then just ran 'php artisan key:generate'.
– Timothy Kruger
Jun 18 '18 at 7:49
I also found that if you download it from the cloud (I'm using windows) i.e. google-drive, sky-drive etc. the .env, .env.example files are named _env, _env.example etc. In that case I renamed the files accordingly and then just ran 'php artisan key:generate'.
– Timothy Kruger
Jun 18 '18 at 7:49
add a comment |
Copy
.env.example
to.env
:
cp -a .env.example .env
Generate a key:
php artisan key:generate
Only then run:
php artisan serve
add a comment |
Copy
.env.example
to.env
:
cp -a .env.example .env
Generate a key:
php artisan key:generate
Only then run:
php artisan serve
add a comment |
Copy
.env.example
to.env
:
cp -a .env.example .env
Generate a key:
php artisan key:generate
Only then run:
php artisan serve
Copy
.env.example
to.env
:
cp -a .env.example .env
Generate a key:
php artisan key:generate
Only then run:
php artisan serve
edited Jan 10 '18 at 8:48
answered Jan 10 '18 at 8:14
Adam PeryAdam Pery
419412
419412
add a comment |
add a comment |
cp .env.example .env
if there is no .env file present.
php artisan key:generate
command works for me. It generates the encryption key
clear the cache usingphp artisan config:cache
command after the above steps.
– Sabyasachi Ghosh
Jan 14 at 10:08
add a comment |
cp .env.example .env
if there is no .env file present.
php artisan key:generate
command works for me. It generates the encryption key
clear the cache usingphp artisan config:cache
command after the above steps.
– Sabyasachi Ghosh
Jan 14 at 10:08
add a comment |
cp .env.example .env
if there is no .env file present.
php artisan key:generate
command works for me. It generates the encryption key
cp .env.example .env
if there is no .env file present.
php artisan key:generate
command works for me. It generates the encryption key
edited Oct 29 '18 at 7:13
Kamran Syed
1436
1436
answered Jul 23 '17 at 15:18
Sabyasachi GhoshSabyasachi Ghosh
489313
489313
clear the cache usingphp artisan config:cache
command after the above steps.
– Sabyasachi Ghosh
Jan 14 at 10:08
add a comment |
clear the cache usingphp artisan config:cache
command after the above steps.
– Sabyasachi Ghosh
Jan 14 at 10:08
clear the cache using
php artisan config:cache
command after the above steps.– Sabyasachi Ghosh
Jan 14 at 10:08
clear the cache using
php artisan config:cache
command after the above steps.– Sabyasachi Ghosh
Jan 14 at 10:08
add a comment |
php artisan key:generate
php artisan config:cache
worked for me, but it had to be done in a command prompt on Windows.
Doing it inside the terminal in PHPStorm didn't worked.
add a comment |
php artisan key:generate
php artisan config:cache
worked for me, but it had to be done in a command prompt on Windows.
Doing it inside the terminal in PHPStorm didn't worked.
add a comment |
php artisan key:generate
php artisan config:cache
worked for me, but it had to be done in a command prompt on Windows.
Doing it inside the terminal in PHPStorm didn't worked.
php artisan key:generate
php artisan config:cache
worked for me, but it had to be done in a command prompt on Windows.
Doing it inside the terminal in PHPStorm didn't worked.
answered Feb 11 '18 at 19:04
José MariaJosé Maria
12114
12114
add a comment |
add a comment |
A common issue you might experience when working on a Laravel application is the exception:
RuntimeException No application encryption key has been specified.
You'll often run into this when you pull down an existing Laravel application, where you copy the .env.example
file to .env
but don't set a value for the APP_KEY
variable.
At the command line, issue the following Artisan command to generate a key:
php artisan key:generate
This will generate a random key for APP_KEY
, After completion of .env
edit please enter this command in your terminal for clear cache:php artisan config:cache
Also, you have to restart the server now you will not get to see this error message.
add a comment |
A common issue you might experience when working on a Laravel application is the exception:
RuntimeException No application encryption key has been specified.
You'll often run into this when you pull down an existing Laravel application, where you copy the .env.example
file to .env
but don't set a value for the APP_KEY
variable.
At the command line, issue the following Artisan command to generate a key:
php artisan key:generate
This will generate a random key for APP_KEY
, After completion of .env
edit please enter this command in your terminal for clear cache:php artisan config:cache
Also, you have to restart the server now you will not get to see this error message.
add a comment |
A common issue you might experience when working on a Laravel application is the exception:
RuntimeException No application encryption key has been specified.
You'll often run into this when you pull down an existing Laravel application, where you copy the .env.example
file to .env
but don't set a value for the APP_KEY
variable.
At the command line, issue the following Artisan command to generate a key:
php artisan key:generate
This will generate a random key for APP_KEY
, After completion of .env
edit please enter this command in your terminal for clear cache:php artisan config:cache
Also, you have to restart the server now you will not get to see this error message.
A common issue you might experience when working on a Laravel application is the exception:
RuntimeException No application encryption key has been specified.
You'll often run into this when you pull down an existing Laravel application, where you copy the .env.example
file to .env
but don't set a value for the APP_KEY
variable.
At the command line, issue the following Artisan command to generate a key:
php artisan key:generate
This will generate a random key for APP_KEY
, After completion of .env
edit please enter this command in your terminal for clear cache:php artisan config:cache
Also, you have to restart the server now you will not get to see this error message.
edited Jan 12 at 9:54
answered Feb 27 '18 at 10:02
Udhav SarvaiyaUdhav Sarvaiya
1,89461624
1,89461624
add a comment |
add a comment |
Okay, I'll write another instruction, because didn't find the clear answer here. So if you faced such problems, follow this:
- Rename or copy/rename .env.example file in the root of your project to .env.
You should not just create empty .env file, but fill it with
content of .env.example.
- In the terminal go to the project root directory(not public folder) and run
php artisan key:generate
- If everything is okay, the response in the terminal should look like this
Application key [base64:wbvPP9pBOwifnwu84BeKAVzmwM4TLvcVFowLcPAi6nA=]
set successfully.
- Now just copy key itself and paste it in your .env file as the value to APP_KEY. Result line should look like this:
APP_KEY=base64:wbvPP9pBOwifnwu84BeKAVzmwM4TLvcVFowLcPAi6nA=
- In terminal run
php artisan config:cache
That's it.
Sophp artisan key:generate
didn't automatically add the key to your .env file?
– Ross Wilson
Jul 25 '18 at 12:39
No, in my case.
– Dmitry Gordienko
Jul 25 '18 at 12:48
add a comment |
Okay, I'll write another instruction, because didn't find the clear answer here. So if you faced such problems, follow this:
- Rename or copy/rename .env.example file in the root of your project to .env.
You should not just create empty .env file, but fill it with
content of .env.example.
- In the terminal go to the project root directory(not public folder) and run
php artisan key:generate
- If everything is okay, the response in the terminal should look like this
Application key [base64:wbvPP9pBOwifnwu84BeKAVzmwM4TLvcVFowLcPAi6nA=]
set successfully.
- Now just copy key itself and paste it in your .env file as the value to APP_KEY. Result line should look like this:
APP_KEY=base64:wbvPP9pBOwifnwu84BeKAVzmwM4TLvcVFowLcPAi6nA=
- In terminal run
php artisan config:cache
That's it.
Sophp artisan key:generate
didn't automatically add the key to your .env file?
– Ross Wilson
Jul 25 '18 at 12:39
No, in my case.
– Dmitry Gordienko
Jul 25 '18 at 12:48
add a comment |
Okay, I'll write another instruction, because didn't find the clear answer here. So if you faced such problems, follow this:
- Rename or copy/rename .env.example file in the root of your project to .env.
You should not just create empty .env file, but fill it with
content of .env.example.
- In the terminal go to the project root directory(not public folder) and run
php artisan key:generate
- If everything is okay, the response in the terminal should look like this
Application key [base64:wbvPP9pBOwifnwu84BeKAVzmwM4TLvcVFowLcPAi6nA=]
set successfully.
- Now just copy key itself and paste it in your .env file as the value to APP_KEY. Result line should look like this:
APP_KEY=base64:wbvPP9pBOwifnwu84BeKAVzmwM4TLvcVFowLcPAi6nA=
- In terminal run
php artisan config:cache
That's it.
Okay, I'll write another instruction, because didn't find the clear answer here. So if you faced such problems, follow this:
- Rename or copy/rename .env.example file in the root of your project to .env.
You should not just create empty .env file, but fill it with
content of .env.example.
- In the terminal go to the project root directory(not public folder) and run
php artisan key:generate
- If everything is okay, the response in the terminal should look like this
Application key [base64:wbvPP9pBOwifnwu84BeKAVzmwM4TLvcVFowLcPAi6nA=]
set successfully.
- Now just copy key itself and paste it in your .env file as the value to APP_KEY. Result line should look like this:
APP_KEY=base64:wbvPP9pBOwifnwu84BeKAVzmwM4TLvcVFowLcPAi6nA=
- In terminal run
php artisan config:cache
That's it.
edited Jan 8 at 5:56
Prakash Pazhanisamy
8681923
8681923
answered Jul 25 '18 at 11:49
Dmitry GordienkoDmitry Gordienko
716
716
Sophp artisan key:generate
didn't automatically add the key to your .env file?
– Ross Wilson
Jul 25 '18 at 12:39
No, in my case.
– Dmitry Gordienko
Jul 25 '18 at 12:48
add a comment |
Sophp artisan key:generate
didn't automatically add the key to your .env file?
– Ross Wilson
Jul 25 '18 at 12:39
No, in my case.
– Dmitry Gordienko
Jul 25 '18 at 12:48
So
php artisan key:generate
didn't automatically add the key to your .env file?– Ross Wilson
Jul 25 '18 at 12:39
So
php artisan key:generate
didn't automatically add the key to your .env file?– Ross Wilson
Jul 25 '18 at 12:39
No, in my case.
– Dmitry Gordienko
Jul 25 '18 at 12:48
No, in my case.
– Dmitry Gordienko
Jul 25 '18 at 12:48
add a comment |
You can generate Application Encryption Key using this command:
php artisan key:generate
Then, create a cache file for faster configuration loading using this command:
php artisan config:cache
Or, serve the application on the PHP development server using this command:
php artisan serve
That's it!
add a comment |
You can generate Application Encryption Key using this command:
php artisan key:generate
Then, create a cache file for faster configuration loading using this command:
php artisan config:cache
Or, serve the application on the PHP development server using this command:
php artisan serve
That's it!
add a comment |
You can generate Application Encryption Key using this command:
php artisan key:generate
Then, create a cache file for faster configuration loading using this command:
php artisan config:cache
Or, serve the application on the PHP development server using this command:
php artisan serve
That's it!
You can generate Application Encryption Key using this command:
php artisan key:generate
Then, create a cache file for faster configuration loading using this command:
php artisan config:cache
Or, serve the application on the PHP development server using this command:
php artisan serve
That's it!
edited Dec 31 '18 at 10:35
answered Dec 1 '18 at 10:06
Prakash PazhanisamyPrakash Pazhanisamy
8681923
8681923
add a comment |
add a comment |
or if your .env file needs to be changed ref: stackoverflow.com/questions/36276767/…
– Nameishi
Aug 12 '17 at 23:20
2
The answers below are correct: however, if you first run "php artisan serve" and have an active web server session you will need to restart the server (control-c in the terminal to stop) to get the change to take effect after you add the key to your .env file.
– Chris Adams
Oct 24 '17 at 19:51