您的位置:首页 > 编程语言 > PHP开发

yii\web\Request::cookieValidationKey must be configured with a secret key.

2017-01-18 16:21 1381 查看
我的yii2模板是:yii-basic-app-2.0.10.tgz,解压到当前文件夹进行使用;

运行时出现如下错误:

Invalid Configuration – yii\base\InvalidConfigException

yii\web\Request::cookieValidationKey must be configured with a secret key.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

解决方法:

打开文件config\web.PHP, 设置 'cookieValidationKey' => 'true',即可,如;
$config = [
'id' => 'basic',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'true',     //  就是这里了
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  yii
相关文章推荐