Hello
We have migrated a site using yii framework, but having the following issue: Fatal error : Uncaught Error: Call to undefined method Yii::createWebApplication() in /home/site/public_html/index.php:13 Stack trace: #0 {main} thrown in /home/site/public_html/index.php on line 13
We already changed the path to where the framework bas been installed.
the index.php page is as follows
<?php
setlocale(LC_ALL, 'fr_FR');
// change the following paths if necessary
$yii='/yii/framework/Yii.php';
$config=dirname(__FILE__).'/protected/config/main-humilis.php';
// remove the following lines when in production mode
//defined('YII_DEBUG') or define('YII_DEBUG',false);
// 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();
Check declaration of createWebApplication inside YiiBase.php
public static function createWebApplication($config=null)
{
return self::createApplication(āCWebApplicationā,$config);
}
inherited in yii.php/Yii.php
class Yii extends YiiBase
{
}
Hello
thanks a lot for your reply. If the site is developed using version 1.1 and we have migrated the site to a server having version 2.0. would that implicate changes in the code? Or should it work the same?
Thanks
They can be installed in parallel. In Yii2 thereās a āvendorā directory for the framework.
I did some testing of missing/misnamed classes. Didnāt get the same error message.
But if createWebApplication is missing/misnamed, the error message will be like yours.
Two suggestions:
Check if YiiBase is corrupted.
Check if the Yii class inherits from YiiBase (or some other custom class to investigate further)