yii\web\Request::cookieValidationKey must be configured with a secret key.
2016-08-09 23:49
501 查看
参考:http://www.yiiframework.com/forum/index.php/topic/56238-cookievalidationkey-must-be-configured-with-a-secret-key/
我的yii2模板是:yii-basic-app-2.0.9.tgz
解压后执行命令:yii serve --port=8888
访问:http://localhost:8888/
出现如下错误:
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',
],
........
我的yii2模板是:yii-basic-app-2.0.9.tgz
解压后执行命令:yii serve --port=8888
访问:http://localhost:8888/
出现如下错误:
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\web\Request::cookieValidationKey must be configured with a secret key.
- Yii2.0 安装使用报错:cookieValidationKey和读取配置文件中的数据
- Attribute value request.getAttribute("keyWord") is quoted with " which must be escaped when used wit
- vSphere Web Client 5.1: Must be registered with the Lookup Service
- Attribute value request.getParameter("digyso") is quoted with " which must be escaped when used within the value
- Attribute value request.getAttribute("xxxx") is quoted with " which must be
- Attribute value request.getParameter("itemID") is quoted with " which must be escaped when used with
- 问题解决: Attribute value request.getParameter("id") is quoted with " which must be escaped when used wi
- Attribute value request.getParameter("name") is quoted with " which must be escaped when used
- android WebView加载不出网页内容This request has been blocked; the content must be served over HTTPS.
- android WebView加载不出网页内容This request has been blocked; the content must be served over HTTPS.
- .jsp文件在tomcat运行,提示 Attribute value request.getParameter("name") is quoted with " which must be escap
- symfony报错:Declaration of testAction::execute() must be compatible with sfComponent::execute($request
- 问题解决: Attribute value request.getParameter("id") is quoted with " which must be escaped when used wi
- Attribute value request.getAttribute("keyWord") is quoted with " which must be escaped when used wi
- 问题解决: Attribute value request.getParameter("id") is quoted with " which must be escaped when used within the value
- Ajax Throws Sys.WebForms.PageRequestManagerErrorException with Response.Redirect的解决方法
- Control ‘dg’ of type 'GridView' must be placed inside a form tag with runat=server
- The function default must be used with a prefix when a default namespace is not specified
- 跨域读取Cookie和session之HttpWebRequest另类方法(网站API开发)