-
Hi guys, I have good knowledge of the fundamentals of web stack - html, css, js, php. Currently I am trying to learn and understand laravel framework in php. I started a new laravel project and am configuring the .env file. I ran command php artisan key:generate, it says key has been generated but it is not showing next to APP_KEY in the .env file. Any help please, I tried chat gpt but couldn't solve this. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
I never had this problem, even tried this now through |
Beta Was this translation helpful? Give feedback.
-
I used composer create-project.. I have php version 8.2. Is annoying why the app key is not showing in the .env file. Is there any way to find out what the app key is so I can type it in the .env file next to APP_KEY? |
Beta Was this translation helpful? Give feedback.
-
hi somehow I managed to solve this, maybe by luck. I downloaded open SSL which is open source and ran this command in cmd openssl rand -base64 32 this effectively runs and spits out an app key that you can use. I then copied and pasted this app key into the .env file in my laravel project. I then went and saved it but I accidentally saved the .env file as env.txt so this created another file in my project. After deleting this plain text env file, I noticed that the normal app key generated by php artisan magically appeared in my original .env file ;) Pretty good, maybe a solution others can use to fix this issue if they run into problems with this. |
Beta Was this translation helpful? Give feedback.
-
I have an other solution for that, I used "composer install" or "composer update" first, then you can type "php artisan key:generate" as well and the key will be generate automatically. |
Beta Was this translation helpful? Give feedback.
hi somehow I managed to solve this, maybe by luck.
I downloaded open SSL which is open source and ran this command in cmd openssl rand -base64 32
this effectively runs and spits out an app key that you can use. I then copied and pasted this app key into the .env file in my laravel project. I then went and saved it but I accidentally saved the .env file as env.txt so this created another file in my project. After deleting this plain text env file, I noticed that the normal app key generated by php artisan magically appeared in my original .env file ;)
Pretty good, maybe a solution others can use to fix this issue if they run into problems with this.