致命错误:Class' CWebApplication'找不到...第125行的YiiRoot / framework / YiiBase.php

时间:2015-11-30 09:16:54

标签: php web-applications yii

我无法在服务器上访问此文件。我收到以下错误

Fatal error: Class 'CWebApplication' not found in DOMAIN/YiiRoot/framework/YiiBase.php on line 125

framework/YiiBase.php

123 public static function createApplication($class,$config=null)
124 {
125  return new $class($config);
126 }

1 个答案:

答案 0 :(得分:0)

确保您已正确设置yii应用程序。

如果您正在使用yii1,请检查您的应用中是否存在protected/config/main.php,因为这是在index.php文件中调用的:

<?php

$yii=dirname(__FILE__).'/../yii/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php'; //make sure this exists

defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

require_once($yii);
Yii::createWebApplication($config)->run(); //this is the reason for your error

我想最后一行Yii::createWebApplication($config)->run();是导致错误的原因,因为它无法在main.php中找到config/个文件