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.php

看了 宏玄的专栏git

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

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

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

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

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

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

APP_KEY=base64:xxxxxxxxxxxxx=

而个人状况是压根没有 .env 文件. 个人项目是从项目组远程git仓库中pull下来的天然没有 .env 文件了.get

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

php artisan key:generate

这个命令能够生成 APP_KEY .

相关文章
相关标签/搜索