Migrating of site

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

Can you please help?
Thanks

You probable didn’t adjust the path assigned to the $yii variable.

(moved to Yii 1.1 section)

1 Like

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 the case here
$yii=’/yii/framework/Yii.php’;

It’s yii.php in original.

thanks. But it start with capital ‘Y’ in the folder.
Could it be something else?

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
{
}

or perhaps there’s some customization involved?

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)

Ok thanks. the file is named BaseYii.php and I dont see the function createWebApplication.
Is it normal?

It may be normal if BaseYii inherits from YiiBase, similar to what I posted above.
.(assuming the class name also is BaseYii)

I suggest you to read this migration guide and understand exactly what you are missing.