Laravel 5.2 does not work on php 7 on Windows 10

I followed every direction, but I can not get Laravel 5.2 to work on php 7 in Windows 10. On the same server I have Laravel 4.2 (this is the application I want to update), working without any problems. None of the answers to such questions seem to work.

The error I am getting is:

No supported encrypter found. The cipher and / or key length are invalid. 

If I use the encryption method for MCRYPT_RIJNDAEL_128, the error will be:

 mcrypt_encrypt(): Key of size 0 not supported by this algorithm. Only keys of sizes 16, 24 or 32 supported 

I tried

  • php-artisan key: generate
  • php artisan config: clear
  • php artisan clear-compiled
  • php artisan config: clear
  • adding the application key to /config/app.php, deleting the .env file, adding the key to .env and app.php and still does not work.

Currently, my .env file is as follows.

. env file

and my app.php file looks like this. app.php

How to solve this problem? Currently, only the homepage works. Login and registration pages do not work with the errors mentioned above.

Laravel was installed as follows: create-project --prefer-dist laravel/laravel appdir

+5
source share
1 answer

Do not worry, this is a common problem that is easy to miss.

In your app.php file you are trying to find the env key somestring (in this case, the actual value you want to return), and not the key where you set the value in the env file.

Installing key in the app.php file as follows:

'key' => env('APP_KEY')

Must correctly search for APP_KEY in your env file and set the appropriate value!

+4
source

Source: https://habr.com/ru/post/1244662/


All Articles