Answer the question
In order to leave comments, you need to log in
Why doesn't the debag panel turn on?
Initially, the project did not have debug and gii versions and the panel was not displayed, I specified "~ 2.0.0" and the composer was updated, although with errors:
main-local (backend)
<?php
return [
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'RlQalJ6jcjOhtJZU0pBjNRT0-lo1YzIg',
],
],
];
if (!YII_ENV_TEST) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
];
}
return $config;
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-backend',
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'backend\controllers',
'bootstrap' => ['log'],
'modules' => [
'debug' => [
'class' => 'yii\debug\Module',
'allowedIPs' => ['*']
],
],
'defaultRoute' => 'order/index',
'components' => [
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'site/error',
],
],
'params' => $params,
];
Answer the question
In order to leave comments, you need to log in
Specify available IPs, or for all
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
'allowedIPs' => ['*'],
];
Good evening.
If the site is on a local server, then remove it 'allowedIPs' => ['*']
, and if on a hosting, then instead of "*" indicate the real ip address from which you access the site. You can find out the ip at https://2ip.ru/
Also clean the runtime/debug directory, set the rights to all directories in runtime www-data.
To do this, run the command in the consolesudo chown www-data:www-data folder_name
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question