Oops, something seems to have gone wrong. Laravel 5.1

I have such a route

http://localhost/inspection/show/{id} 

When I try to load a route at the same time. In different tabs, sometimes some of these tabs have the error "Oops, it looks like something went wrong"

Download on different tabs so fast

 http://localhost/inspection/show/8 http://localhost/inspection/show/9 http://localhost/inspection/show/10 http://localhost/inspection/show/11 

Stack trace has this

 [2015-08-06 14:57:53] local.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Encryption\EncryptionServiceProvider.php:29 Stack trace: #0 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Container\Container.php(733): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}(Object(Illuminate\Foundation\Application), Array) #1 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Container\Container.php(626): Illuminate\Container\Container->build(Object(Closure), Array) #2 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(674): Illuminate\Container\Container->make('encrypter', Array) #3 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Container\Container.php(837): Illuminate\Foundation\Application->make('Illuminate\\Cont...') #4 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Container\Container.php(800): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #5 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Container\Container.php(771): Illuminate\Container\Container->getDependencies(Array, Array) #6 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Container\Container.php(626): Illuminate\Container\Container->build('IAServer\\Http\\M...', Array) #7 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(674): Illuminate\Container\Container->make('IAServer\\Http\\M...', Array) #8 C:\wamp\www\iaserver\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(143): Illuminate\Foundation\Application->make('IAServer\\Http\\M...') #9 C:\wamp\www\iaserver\public\index.php(58): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response)) #10 {main} 

The .env file is correct, I re-run the php artisan key: generated

 APP_ENV=local APP_DEBUG=true APP_KEY=UC5Fsvi8JsGG4U72k04rS3o5csiINDYB 

But the error still appears only when the route loads quickly with a different identifier.

Why?

I decided sometimes laravel did not read APP_KEY in .ENV. And it returns the value "SomeRandomString" (defined by default in config / app.php), and the error "key length is invalid", so the solution should copy the value APP_KEY to the value "key" in config / app.php, that's all! I decided!

+7
laravel artisan
source share
1 answer

You can try running php artisan key:generate again, this should fix the problem.

+2
source share

All Articles