laravel 找不到支持的加密器.密码和/或密钥长度无效 [英] laravel No supported encrypter found. The cipher and / or key length are invalid

查看:22
本文介绍了laravel 找不到支持的加密器.密码和/或密钥长度无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Laravel 构建一个项目.它在本地主机上运行良好,但是当我将它上传到服务器时(服务器安装了 comodo ssl),我收到以下错误:

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?

推荐答案

您是否在服务器上安装了所有必要的扩展?

Do you have all the necessary extensions installed on the server?

  • PHP >= 5.5.9
  • OpenSSL PHP 扩展
  • PDO PHP 扩展
  • Mbstring PHP 扩展
  • Tokenizer PHP 扩展

可能是您缺少 OpenSSL 扩展.另外,您是否在 .env 文件中设置了密钥?

It could be that you're missing the OpenSSL extension. Also, do you have the key set in .env file?

尝试运行:

php artisan key:generate

答案:'cipher' =>'' 未设置.

这篇关于laravel 找不到支持的加密器.密码和/或密钥长度无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆