I'm trying to disable the use of Redis in a bus ticketing project and enable caching with the file system but I get an error

main.php catalog www/common/config/
return [
‘id’ => ‘my-bus-service’,
‘basePath’ => dirname(DIR),
‘vendorPath’ => dirname(dirname(DIR)) . ‘/vendor’,
‘container’ => [
‘definitions’ => [
‘common\services\content\ContentServiceInterface’ => ‘common\services\content\ContentService’,
‘common\repositories\content\ContentRepositoryInterface’ => ‘common\repositories\content\ContentRepository’,
‘common\repositories\trip\TripRepositoryInterface’ => ‘common\repositories\trip\TripRepository’,
‘common\services\trip\TripServiceInterface’ => ‘common\services\trip\TripService’,
‘common\services\auth\AuthServiceInterface’ => ‘common\services\auth\AuthService’,
‘common\repositories\user\UserRepositoryInterface’ => ‘common\repositories\user\UserRepository’,
‘common\repositories\token\TokenRepositoryInterface’ => ‘common\repositories\token\TokenRepository’,
‘common\services\token\TokenServiceInterface’ => ‘common\services\token\TokenService’,
‘common\services\profile\ProfileServiceInterface’ => ‘common\services\profile\ProfileService’,
‘common\repositories\profile\ProfileRepositoryInterface’ => ‘common\repositories\profile\ProfileRepository’,
‘common\services\order\OrderServiceInterface’ => ‘common\services\order\OrderService’,
],
‘singletons’ => [
‘common\services\external\ExternalServiceInterface’ => ‘common\services\external\ExternalService’
]
],
‘components’ => [
‘cache’ => [
‘class’ => ‘yii\caching\FileCache’,
‘cachePath’ => ‘@runtime/cache’,
]
],
];
old file <?php
return [
‘vendorPath’ => dirname(dirname(DIR)) . ‘/vendor’,
‘container’ => [
‘definitions’ => [
‘common\services\content\ContentServiceInterface’ => ‘common\services\content\ContentService’,
‘common\repositories\content\ContentRepositoryInterface’ => ‘common\repositories\content\ContentRepository’,
‘common\repositories\trip\TripRepositoryInterface’ => ‘common\repositories\trip\TripRepository’,
‘common\services\trip\TripServiceInterface’ => ‘common\services\trip\TripService’,
‘common\services\auth\AuthServiceInterface’ => ‘common\services\auth\AuthService’,
‘common\repositories\user\UserRepositoryInterface’ => ‘common\repositories\user\UserRepository’,
‘common\repositories\token\TokenRepositoryInterface’ => ‘common\repositories\token\TokenRepository’,
‘common\services\token\TokenServiceInterface’ => ‘common\services\token\TokenService’,
‘common\services\profile\ProfileServiceInterface’ => ‘common\services\profile\ProfileService’,
‘common\repositories\profile\ProfileRepositoryInterface’ => ‘common\repositories\profile\ProfileRepository’,
‘common\services\order\OrderServiceInterface’ => ‘common\services\order\OrderService’,

    ],
    'singletons' => [
        'common\services\external\ExternalServiceInterface' => 'common\services\external\ExternalService'
    ]
],
'components' => [
    'cache' => [
        'class' => 'yii\redis\Cache',
        'redis' => [
            'hostname' => 'localhost',
            'port' => 6379,
            'database' => 1
        ]
    ],
],

];
but i get a mistake return [ ‘id’ => ‘my-bus-service’, ‘basePath’ => dirname(DIR), ‘vendorPath’ => dirname(dirname(DIR)) . ‘/vendor’, ‘container’ => [ ‘definitions’ => [ ‘common\services\content\ContentServiceInterface’ => ‘common\services\content\ContentService’, ‘common\repositories\content\ContentRepositoryInterface’ => ‘common\repositories\content\ContentRepository’, ‘common\repositories\trip\TripRepositoryInterface’ => ‘common\repositories\trip\TripRepository’, ‘common\services\trip\TripServiceInterface’ => ‘common\services\trip\TripService’, ‘common\services\auth\AuthServiceInterface’ => ‘common\services\auth\AuthService’, ‘common\repositories\user\UserRepositoryInterface’ => ‘common\repositories\user\UserRepository’, ‘common\repositories\token\TokenRepositoryInterface’ => ‘common\repositories\token\TokenRepository’, ‘common\services\token\TokenServiceInterface’ => ‘common\services\token\TokenService’, ‘common\services\profile\ProfileServiceInterface’ => ‘common\services\profile\ProfileService’, ‘common\repositories\profile\ProfileRepositoryInterface’ => ‘common\repositories\profile\ProfileRepository’, ‘common\services\order\OrderServiceInterface’ => ‘common\services\order\OrderService’, ], ‘singletons’ => [ ‘common\services\external\ExternalServiceInterface’ => ‘common\services\external\ExternalService’ ] ], ‘components’ => [ ‘cache’ => [ ‘class’ => ‘yii\caching\FileCache’, // Укажите путь к каталогу, где будут храниться файлы кеша ‘cachePath’ => ‘@runtime/cache’, ] // Другие настройки компонентов ], ];
Fatal error : Uncaught yii\base\InvalidConfigException: The “id” configuration for the Application is required. in /home/ihorbor1/eeep.homes/www/vendor/yiisoft/yii2/base/Application.php:219 Stack trace: #0 /home/ihorbor1/eeep.homes/www/vendor/yiisoft/yii2/base/Application.php(201): yii\base\Application->preInit(1) #1 /home/ihorbor1/eeep.homes/www/frontend/web/index.php(17): yii\base\Application->__construct(1) #2 {main} thrown in /home/ihorbor1/eeep.homes/www/vendor/yiisoft/yii2/base/Application.php on line 219

Hi.
First, your post is really hard to reading. Use proper formatting please. See https://forum.yiiframework.com/t/welcome-to-the-yii-framework-forum/8#general-guidelines-2

To your problem, because of:

Uncaught yii\base\InvalidConfigException: The “id” configuration for the Application is required. […]
Stack trace:
#0 /home/ihorbor1/eeep.homes/www/vendor/yiisoft/yii2/base/Application.php(201): yii\base\Application->preInit(1)
#1 /home/ihorbor1/eeep.homes/www/frontend/web/index.php (17): yii\base\Application->__construct(1)

Examine path your code is creating actual $config[], starting from index.php. Maybe somewhere on the road you are merging some config arrays and loose the ‘id’ key?

I have a project to purchase bus tickets and API data is requested
The database was lost and I restored it using migration files
Redis caching is worth it, but since redis is temporarily not running, I wanted to disable it by replacing the line
‘components’ => [
** ‘cache’ => [**
** ‘class’ => ‘yii\redis\Cache’,**
** ‘redis’ => [**
** ‘hostname’ => ‘localhost’,**
** ‘port’ => 6379,**
** ‘database’ => 1**
** ]**
on

‘components’ => [
*** ‘cache’ => [***
*** ‘class’ => ‘yii\caching\FileCache’,***
*** // Specify the path to the directory where the cache files will be stored***
*** ‘cachePath’ => ‘@runtime/cache’,***
but now have this error there index.php <?php
defined(‘YII_DEBUG’) or define(‘YII_DEBUG’, false);
defined(‘YII_ENV’) or define(‘YII_ENV’, ‘prod’);

require(DIR . ‘/…/…/vendor/autoload.php’);
require(DIR . ‘/…/…/vendor/yiisoft/yii2/Yii.php’);
require(DIR . ‘/…/…/common/config/bootstrap.php’);
require(DIR . ‘/…/config/bootstrap.php’);

$config = yii\helpers\ArrayHelper::merge(
require(DIR . ‘/…/…/common/config/main.php’),
require(DIR . ‘/…/…/common/config/main-local.php’),
require(DIR . ‘/…/config/main.php’),
require(DIR . ‘/…/config/main-local.php’)
);

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

Again, please use proper formatting. There is </> icon in the editor prepared exactly for code snippets you pasted.

The error states clearly:

Fatal error : Uncaught yii\base\InvalidConfigException: The “id” configuration for the Application is required. in /home/ihorbor1/eeep.homes/www/vendor/yiisoft/yii2/base/Application.php:219

When you look at the framework code, there is nothing more but simple key exist check in config array.

https://github.com/yiisoft/yii2/blob/master/framework/base/Application.php

public function preInit(&$config)
    {
        if (!isset($config['id'])) { // here is the test
            throw new InvalidConfigException('The "id" configuration for the Application is required.'); //line 219
        }

Trace the path how your config is build, with the step debugger. Find why there is no ‘id’ key in your config.