Answer the question
In order to leave comments, you need to log in
How to get rid of Yii2 500 error after migrating to hosting?
Good morning!
I recently published the files of a Yii2 site without a hosting project and encountered a 500 error when accessing the root folder by domain.
Since, thanks to popular articles on the correct configuration of Yii2, everything was configured correctly. This allegedly caused a problem. How to solve it so that the site itself can be launched on a hosting?
Project structure in hosting domain (Linux ls command):
assets commands composer.json config InvestPortal.geany models runtime vagrant views widgets yii.bat
codeception.yml components composer.lock controllers mail requirements.php tests vendor web yii
<?php
// 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 '../vendor/autoload.php';
require '../vendor/yiisoft/yii2/Yii.php';
$config = require '../config/web.php';
(new yii\web\Application($config))->run();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question