Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

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

I am building a project using Laravel. It was working fine on localhost, but when I upload it to the server (the server has comodo ssl installed), I receive the following error:

RuntimeException in EncryptionServiceProvider.php line 29:
No supported encrypter found. The cipher and / or key length are invalid
in EncryptionServiceProvider.php line 29
at EncryptionServiceProvider->IlluminateEncryption{closure}(object(Application), array()) in Container.php line 733
at Container->build(object(Closure), array()) in Container.php line 626
at Container->make('encrypter', array()) in Application.php line 674
at Application->make('IlluminateContractsEncryptionEncrypter') in Container.php line 837
at Container->resolveClass(object(ReflectionParameter)) in Container.php line 800
at Container->getDependencies(array(object(ReflectionParameter)), array()) in Container.php line 771
at Container->build('SahraSalonHttpMiddlewareEncryptCookies', array()) in Container.php line 626
at Container->make('SahraSalonHttpMiddlewareEncryptCookies', array()) in Application.php line 674
at Application->make('SahraSalonHttpMiddlewareEncryptCookies') in Pipeline.php line 123
at Pipeline->IlluminatePipeline{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
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 124
at Pipeline->IlluminatePipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 118
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 86
at Kernel->handle(object(Request)) in index.php line 54

Can anyone help solve this error?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You only type in console:

php artisan key:generate

And if your app.php not change this Key, change manually.


Next if you should then happen to get this error message:

[ErrorException]
file_get_contents(/path/to/my/project/.env): failed to open stream: No such file or directory

Then make a copy of the .env.example file and try again:

cp .env.example .env
php artisan key:generate

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...