havietduc91 / yii-framework

0 stars 0 forks source link

Lỗi hay gặp #2

Open havietduc91 opened 8 years ago

havietduc91 commented 8 years ago
Invalid Configuration – yii\base\InvalidConfigException yii\web\Request::cookieValidationKey must be configured with a secret key.

-> http://www.yiiframework.com/forum/index.php/topic/56238-cookievalidationkey-must-be-configured-with-a-secret-key/

Go to main.config
'components' => [
    'request' => [
        'enableCookieValidation' => true,
        'enableCsrfValidation' => true,
        'cookieValidationKey' => 'xxxxxxx',
    ],
],
havietduc91 commented 8 years ago
Không thấy file index.php đâu cả

Là do chưa chạy 2 file init.batch và yii.batch. Sau khi chạy 2 file này sẽ có các file index.php và index_test.php ở trong 2 thư mục web và frontend khi cài đặt yii advanced

havietduc91 commented 8 years ago

Lỗi DB khi login ở backend advanced yii

screenshot_1

Do chưa migrate dữ liệu Vào trong thư mục yii-advance, sau đó chạy các lệnh sau:

- php init
- php yii migrate
havietduc91 commented 8 years ago

Khi cài dự án đang bị lỗi

$accessToken = $cache->get($cacheKey);
var_dump($accessToken); //null
ME_PRIVATE_USERNAME = apiuser
ME_PRIVATE_PASSWORD = L1kaBanaani
php yii config/build
//php yii rbac/init-user-roles
havietduc91 commented 8 years ago
Chưa vào được các link của dự án bằng needseeker.dev

Tạo file .htaccess với nội dung như sau

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

Sau đó thêm file này vào trong thư mục web của dự án

havietduc91 commented 8 years ago
Lỗi gặp khi chạy unit test ở service

Chuyển require (dirname(dirname(__DIR__)) . '/_bootstrap.php'); => require (dirname(__DIR__) . '/_bootstrap.php'); Và move phần khởi tạo từ setUp => before

havietduc91 commented 8 years ago

yii command not found

https://github.com/Filsh/yii2-gearman/issues/4 php yii config/build or ./yii config/build