O
O
on_click2019-07-24 15:04:06
Yii
on_click, 2019-07-24 15:04:06

Why might this error occur? How to run remote yii application locally?

Good afternoon. I'm completely new to yii, I'm trying to launch a site on my openserver from a remote server.
I downloaded all the files, filled in the database, went through the absolute paths with autocorrect, entered the data from the database.
At the root of the site, I got the following structure. 5d38488997bd4808037923.pngTo start, I go to site.loc/public
and see an error:

CException
Контроллер SiteController не может найти представление "error".

Googling, I came across an option that the path to views may not be correctly specified, but I could not find where it could be indicated.
please tell me what could be wrong.
perhaps the standard steps for transferring a site are not quite what you should have done?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2019-07-24
@on_click

The problem with views can be in several cases:
1. The rendering path is incorrect. If you transferred only folders, then you also need to set up viewPath
2. If you set up viewPath and still have problems, the problem is the path is correct. Either the full path was not specified, or the case of letters was not respected.
Most likely the first way.
Own way. Application settings might look like this:

return [
    'viewPath' => '@app/modules/users/views/frontend',
];

Temerization
return [
    'components' => [
        'view' => [
            'theme' => [
                'basePath' => '@app/themes/basic',
                'baseUrl' => '@web/themes/basic',
                'pathMap' => [
                    '@app/views' => '@app/themes/basic',
                ],
            ],
        ],
    ],
];

Module setup:
return [
'modules' => [
        'users' => [
            'class' => app\modules\users\Module::class,
            'controllerNamespace' => 'app\modules\users\controllers\frontend',
            'viewPath' => '@app/modules/users/views/frontend',
            'layout' => '@app/views/layouts/column2-right.php',
        ],
]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question