Whoops, looks like something went wrong.
Hi! Sorry total noob here I was wondering what I could do to solve this error:
It runs fine locally, so my steps are
- upload the archive.zip then extract
- change public to public_html
- edit env to reflect the hosting database / url
- import local database onto hosting
I get the following error when accessing my site
[code]
Whoops, looks like something went wrong.
1/1 RuntimeException in EncryptionServiceProvider.php line 45: No supported encrypter found. The cipher and / or key length are invalid. in EncryptionServiceProvider.php line 45 at EncryptionServiceProvider->getEncrypterForKeyAndCipher(null, 'AES-256-CBC') in EncryptionServiceProvider.php line 25 at EncryptionServiceProvider->Illuminate\Encryption{closure}(object(Application), array()) in Container.php line 731 at Container->build(object(Closure), array()) in Container.php line 629 at Container->make('encrypter', array()) in Application.php line 697 at Application->make('encrypter') in Container.php line 849 at Container->resolveClass(object(ReflectionParameter)) in Container.php line 804 at Container->getDependencies(array(object(ReflectionParameter)), array()) in Container.php line 774 at Container->build('App\Http\Middleware\EncryptCookies', array()) in Container.php line 629 at Container->make('App\Http\Middleware\EncryptCookies', array()) in Application.php line 697 at Application->make('App\Http\Middleware\EncryptCookies') in Pipeline.php line 126 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32 at Pipeline->Illuminate\Routing{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102 at Pipeline->then(object(Closure)) in Router.php line 726 at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 699 at Router->dispatchToRoute(object(Request)) in Router.php line 675 at Router->dispatch(object(Request)) in Kernel.php line 246 at Kernel->Illuminate\Foundation\Http{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52 at Pipeline->Illuminate\Routing{closure}(object(Request)) in CheckForMaintenanceMode.php line 44 at CheckForMaintenanceMode->handle(object(Request), object(Closure)) at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32 at Pipeline->Illuminate\Routing{closure}(object(Request)) at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102 at Pipeline->then(object(Closure)) in Kernel.php line 132 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99 at Kernel->handle(object(Request)) in index.php line 53
[/code]
[code]
1/1 RuntimeException in EncryptionServiceProvider.php line 45: No supported encrypter found. The cipher and / or key length are invalid. in EncryptionServiceProvider.php line 45 at EncryptionServiceProvider->getEncrypterForKeyAndCipher(null, 'AES-256-CBC') in EncryptionServiceProvider.php line 25 at EncryptionServiceProvider->Illuminate\Encryption{closure}(object(Application), array()) in Container.php line 731 at Container->build(object(Closure), array()) in Container.php line 629 at Container->make('encrypter', array()) in Application.php line 697 at Application->make('encrypter') in Container.php line 849 at Container->resolveClass(object(ReflectionParameter)) in Container.php line 804 at Container->getDependencies(array(object(ReflectionParameter)), array()) in Container.php line 774 at Container->build('App\Http\Middleware\EncryptCookies', array()) in Container.php line 629 at Container->make('App\Http\Middleware\EncryptCookies', array()) in Application.php line 697 at Application->make('App\Http\Middleware\EncryptCookies') in Kernel.php line 152 at Kernel->terminate(object(Request), object(Response)) in index.php line 58
[/code]
Any advice is appreciated!
Yes, you need putenv, or it can't use the .env.
With that setup, you'd probably have to hardcode your values in the actual config files, which is something I wouldn't want to do, but you've limited yourself with that shared hosting...
So this error is probably coming because it can't use the APP_KEY in your .env, which is needed for encryption, and why null is showing up here instead of your APP_KEY value.
EncryptionServiceProvider->getEncrypterForKeyAndCipher(null, 'AES-256-CBC') in
To confirm, edit /config/app.php and set
'key' => env('APP_KEY'),
to your APP_KEY value in your .env. If it works (you'll get other errors, but should fix this one), then you'd have to do it for all of the other .env vars.
Please or to participate in this conversation.