Tag Archives: yii2

[Solved] yii error: Setting unknown property: yii\console\Request: :cookieValidationKey

1. Command:
php yii
2. Error:
Exception ‘yii\base\UnknownPropertyException’ with message ‘Setting unknown property: yii\console\Request::cookieValidationKey’
3. Reason:
console/yii file

$config = yii\helpers\ArrayHelper::merge(
    require __DIR__ . '/config/main.php',
    require __DIR__ . '/../conf/main-local.php'
);

$application = new yii\console\Application($config);

The above program execution entry combines all configurations before actual operation, and some configuration parameters are invalid for console operation

4. Solution:
Delete these parameters before performing console operations

unset($config['components']['request']);
$application = new yii\console\Application($config);

Parse error: syntax error, unexpected T_OBJECT_OPERATOR in E:\WWW\blog\hyii2\frontend\web\index.php

Yii2.0.32. Advanced Templates.
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in E:\WWW\blog\hyii2\frontend\web\index.php on line 17
https://www.imooc.com/qadetail/189883
This is a syntax error,
The first thing you need to do is check the file E:\WWW\blog\hyii2\ Frontend \ Web \index.php for syntax errors on line 17
If you haven’t touched this file, chances are your VERSION of PHP doesn’t meet the requirements
Yii2 requires at least 5.4 PHP versions