Laravel No supported encrypter found. The cipher and / or key length are invalid
来源:互联网 发布:ubuntu恢复初始命令 编辑:程序博客网 时间:2024/05/19 02:05
刚部署好Laravel 5.1,打开首页的时候提示错误,开启debug模式以后,就看到具体错误信息:No supported encrypter found. The cipher and / or key length are invalid.
问题原因是config/app.php中有一个关于秘钥类型的配置,默认设置为AES-256-CBC
,也就是对应的秘钥必须是32个字符,而默认配置中写的是SomeRandomString
,只有16个字符。当然我们可以通过将cipher设置为AES-128-CBC
来解决这个问题。
但是,毕竟SomeRandomString
也不是个像样的秘钥,我们可以生成一个。只需要下面这个代码:
php artisan key:generateApplication key [tFnLJ1Wo4647KlYxvCsjfMfI2VK5u2Rb] set successfully.
这个时候我们将生成的秘钥,修改到config/app.php的key字段中,替换掉SomeRandomString
就好了。
更新:其实如果使用 laravel new app name 的方式创建项目,是不会遇到这个问题的,因为那种方式会生成一个配置文件,这个配置文件也有关于appkey的设置,具体需要额外执行下面这条命令:
php -r "copy('.env.example', '.env');"php artisan clear-compiledphp artisan optimizephp artisan key:generate
0 0
- laravel No supported encrypter found. The cipher and / or key length are invalid.
- laravel No supported encrypter found. The cipher and / or key length are invalid
- Laravel No supported encrypter found. The cipher and / or key length are invalid
- No supported encrypter found. The cipher and / or key length are invalid.
- No supported encrypter found. The cipher and / or key length are invalid.
- No supported encrypter found. The cipher and / or key length are invalid.
- 关于laravel中key的错误cipher and / or key length are invalid
- laravel 配置 No supported encrypter found
- laravel5.1出现No supported encrypter found错误的解决办法
- ERROR ITMS-9000: "Invalid Image Path - No image found at the path referenced under key 'CFBundleIcon
- Invalid Image Path - No image found at the path referenced under key 'CFBundleIconFile': 'Icon.png'
- ERROR ITMS-90032 : "Invalid Image Path - No image found at the path referenced under key 'CFBundleIc
- ERROR ITMS-90032: "Invalid Image Path - No image found at the path referenced under key 'CFBundkeIco
- ERROR ITMS-90032:“Invalid Image Path - No image found at the path referenced under key 'CFBundleIcon
- The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.
- The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.
- The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.
- The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.
- Find Archive File in SAP BW
- linux下的gcc编译
- r-cnn系列代码编译及解读(1)
- 《TensorfFlow实战》读书笔记(三) —— Tensorflow 实现 Softmax Regression 识别手写数字
- 对抗生成网络(文献、教程、模型、框架、库等)
- Laravel No supported encrypter found. The cipher and / or key length are invalid
- 这是目前在做的事情的进度
- Android状态模式实践
- 三大常用机密算法原理与基础使用MD5、3DES、RSA
- Medium:Find Largest Value in Each Tree Row
- matplotlib的基本用法(八)——绘制柱状图
- 神经网络压缩(3):Learning both Weights and Connections for Efficient Neural Network
- 周志华《机器学习》课后习题解答系列(六):Ch5.8
- 老司机带你探知存储伸缩之道