The only supported ciphers are AES-128-CBC and AES-256-CBC

Laravel production.ERROR: RuntimeException: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

Laravel 报错 Laravel production.ERROR: RuntimeException: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

看了 宏玄的专栏

Laravel 出现"RuntimeException inEncrypter.php line 43: The only
supported ciphers are AES-128-CBC and AES-256-CBC with the correct key
lengths."问题的解决办法

首先在cmd命令行下定位到项目所在的根目录下,接着输入:

[plain] view plain copy 在CODE上查看代码片派生到我的代码片 php artisan key:generate
效果:

这时候项目根目录下的.env文件里的APP_KEY应该会有值了:

若没有,则将上一步生成的key值输入进去即可。

得知在 .env 文件中没有配置 APP_KEY 的情况会出现上述错误

APP_KEY=base64:xxxxxxxxxxxxx=

而我的情况是压根没有 .env 文件. 我的项目是从项目组远程git仓库中pull下来的自然没有 .env 文件了.

补上了 .env 文件问题就解决了, 另外使用

php artisan key:generate

这个命令可以生成 APP_KEY .

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值