подскажите, пожалуйста, как включит панель дебаг и открыть gii?
в локалхост панели нет: https://prnt.sc/pv88xk
локалхост/gii 403 ошбика: https://prnt.sc/pv89b6
127.0.0.1 не открывается вообще: https://prnt.sc/pv8a11 (не пойму почему...) в hosts связка 127.0.0.1 и localhost есть: https://prnt.sc/pv8atf
я сегодня перешел на "встроенный" php сервер, потому что мамп начал глючить с пхп и пропало... на мампе и gii работал и панель отображалась... кофнигурацию не менял... все файлы теже самые...
запускаю так:
Код: Выделить всё
php yii serve --port 10002
web/index.php
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
Код: Выделить всё
<?php
ini_set("memory_limit","1024M");
ini_set("pcre.jit","0");
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
// comment out the following two lines when deployed to production
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';
require __DIR__ . '/../components/MyLoggedApplication.php';
require __DIR__ . '/func.php';
$config = require __DIR__ . '/../config/web.php';
//echo "<pre>"; print_r($config);die();
//(new yii\web\Application($config))->run();
(new app\components\MyLoggedApplication($config))->run();
if (YII_ENV_DEV) тоже подключается...
Код: Выделить всё
$params = require __DIR__ . '/params.php';
$db = require __DIR__ . '/db.php';
$array_of_modules=array();
....
$config = [
'id' => 'basic',
'basePath' => dirname(__DIR__),
'language' => 'ru-RU',
'sourceLanguage' => 'en-US',
'bootstrap' => ['log'],
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
/*
'on beforeRequest' => function ($event) {
if(!Yii::$app->request->isSecureConnection){
$url = Yii::$app->request->getAbsoluteUrl();
$url = str_replace('http:', 'https:', $url);
Yii::$app->getResponse()->redirect($url);
Yii::$app->end();
}
},*/
'modules' => $array_of_modules,
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => '-8',
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
'user' => [
//'identityClass' => 'app\models\User',
'identityClass' => 'app\modules\users\models\User',
'loginUrl' => '/logins/',
'enableAutoLogin' => true,
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'db' => $db,
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
'authManager' => [
'class' => 'app\components\AccessChecker',
],
'i18n' => [
'translations' => [
'app*' => [
'sourceLanguage' => 'en-US',
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@app/messages',
'fileMap' => [
'app' => 'app.php',
'app/error' => 'error.php',
'app/auth' => 'auth.php',
],
],
],
],
],
'params' => $params,
];
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
}
return $config;