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

I could access the same on my localhost but cannot access in my server. Please throw some light.

framework/YiiBase.php

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

protected/index.php

<?php

// change the following paths if necessary
$yii=dirname(__FILE__).'/../framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

require_once($yii);
Yii::createWebApplication($config)->run();
?>
5
  • Always add the relevant part of the code.. What's in line 125 in YiiBase.php? Commented Feb 22, 2015 at 10:29
  • Its understood that since i have not made changes in the framework , it would be the same as default. Commented Feb 22, 2015 at 10:31
  • Though i have added. Please dont down vote :( Commented Feb 22, 2015 at 10:37
  • What do you mean by "I could access the same on my localhost but cannot access in my server". Are you trying to run this from the command line? Commented Feb 23, 2015 at 6:10
  • No! I meant when i run the index.php on localhost it shows me the content but over server i encountered this error. Any help? Commented Feb 23, 2015 at 7:07

1 Answer 1

1

need write

Yii::createApplication('YourWebApplication', $config)->run(); // or standard CWebApplication
Sign up to request clarification or add additional context in comments.

1 Comment

It still does not work. Please tell me if i could add more details?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.