lundi 6 mai 2019

Yii2: Fatal error: Uncaught exception 'yii\base\InvalidConfigException'

I loves this community so much! And it seems now i need ask question by myself because at this time i get no luck with Google.

So, I can't get a PHP web-site to work. It gives such error:

Fatal error: Uncaught exception 'yii\base\InvalidConfigException' with message 'The "id" configuration for the Application is required.' in /var/www/www-root/data/www/abc/vendor/yiisoft/yii2/base/Application.php:220 Stack trace: #0 /var/www/www-root/data/www/abc/vendor/yiisoft/yii2/base/Application.php(202): yii\base\Application->preInit(Array) #1 /var/www/www-root/data/www/somewebsite.com/index.php(20): yii\base\Application->__construct(Array) #2 {main} thrown in /var/www/www-root/data/www/abc/vendor/yiisoft/yii2/base/Application.php on line 220

My index.php is:

<?php
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'prod');

ini_set('session.save_path', 'tmp');
session_start();   

require(__DIR__ . '/../abc/vendor/autoload.php');
require(__DIR__ . '/../abc/vendor/yiisoft/yii2/Yii.php');
require(__DIR__ . '/../abc/common/config/bootstrap.php');
require(__DIR__ . '/../abc/common/config/bootstrap.php');

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

$application = new yii\web\Application($config);
$application->run();

?>

What can be wrong? I installed the Yii framework according to their manual.




Aucun commentaire:

Enregistrer un commentaire