When running
php artisan key:generate
I can see the generated key in my shell, but the variable 'key' in app.php remains empty.
Running on localhost with windows-apache-php 5.4 - mysql.
Never had this problem before with laravel 4 beta version.
Reasons why php artisan serve not workingYou are running php artisan serve command in wrong directory. php artisan serve is laravel command only work with laravel project. Check project directory and run in root directory of your project. The requested host or port is not available.
php artisan key:generate is a command that sets the APP_KEY value in your . env file. By default, this command is run following a composer create-project laravel/laravel command.
The easiest way to generate the key is by using the artisans' command. After this, the APP_KEY value is automatically set in the . env file for you to use it later on. It is used to encrypt the files in your application.
Laravel Artisan is one of the three command line interfaces found in the Laravel framework. It is a helpful command line interface, assisting developers into developing applications though the numerous easy to read commands. One can also create custom codes in order to increase the efficiency of the applications.
Had the same problem ...
- Opened app.php
- Remove the entry that says 'YourSecretKey!!!'
- Ran 'php artisan key:generate'
Showed me a key in the console, but nothing in app.php
!
Solution is ... unlike Laravel 3, don't delete the default YourSecretKey
!!! in app.php
, just run the command and it will work.
Hope this helps.
Bagwaa
You should not remove the original key, just go to your project directory and run
php artisan key:generate
it will work if you don't touch the previous key.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With