Answer the question
In order to leave comments, you need to log in
Why can't $app->run(); work in Yii?
Good evening!
I have such a problem, I uploaded a Yii site to the hosting, and for the first time I encountered a white screen, I give the index.php input code :
define('YII_DEBUG', true);
if($_SERVER['HTTP_HOST'] == 'visakaz'){
$yii = dirname(__FILE__).'/framework/yii.php';
$config = dirname(__FILE__).'/protected/config/dev.php';
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
}
// Иначе выключаем режим отладки и подключаем рабочую конфигурацию
else {
echo 1;
$yii = dirname(__FILE__).'/framework/yiilite.php';
echo 2;
$config = dirname(__FILE__).'/protected/config/production.php';
echo 3;
}
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
echo 4;
require_once($yii);
echo 5;
$app = Yii::createWebApplication($config);
echo 6;
$app->run();
echo 7;
$app->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