将Yii站点转移到新服务器

时间:2011-10-05 00:36:06

标签: php yii

当我通过新域名转移到另一个托管网站时,我收到此PHP错误。我已正确更改了所有数据库设置。我是Yii的新手,不知道如何正确设置。有人说这是PDO的问题,但我不太确定。

我们如何解决这个问题?

Description

include(PDO.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

Source File

/home/fundasha/public_html/libs/framework/YiiBase.php(395)

00383:      * @return boolean whether the class has been loaded successfully
00384:      */
00385:     public static function autoload($className)
00386:     {
00387:         // use include so that the error PHP file may appear
00388:         if(isset(self::$_coreClasses[$className]))
00389:             include(YII_PATH.self::$_coreClasses[$className]);
00390:         else if(isset(self::$classMap[$className]))
00391:             include(self::$classMap[$className]);
00392:         else
00393:         {
00394:             if(strpos($className,'\\')===false)
00395:                 include($className.'.php');
00396:             else  // class name with namespace in PHP 5.3
00397:             {
00398:                 $namespace=str_replace('\\','.',ltrim($className,'\\'));
00399:                 if(($path=self::getPathOfAlias($namespace))!==false)
00400:                     include($path.'.php');
00401:                 else
00402:                     return false;
00403:             }
00404:             return class_exists($className,false) || interface_exists($className,false);
00405:         }
00406:         return true;
00407:     }
Stack Trace

#0 /home/fundasha/public_html/libs/framework/YiiBase.php(395): autoload()
#1 unknown(0): autoload()
#2 /home/fundasha/public_html/libs/framework/db/CDbConnection.php(309): spl_autoload_call()
#3 /home/fundasha/public_html/libs/framework/db/CDbConnection.php(261): CDbConnection->createPdoInstance()
#4 /home/fundasha/public_html/libs/framework/db/CDbConnection.php(242): CDbConnection->open()
#5 /home/fundasha/public_html/libs/framework/db/CDbConnection.php(221): CDbConnection->setActive()
#6 /home/fundasha/public_html/libs/framework/base/CModule.php(372): CDbConnection->init()
#7 /home/fundasha/public_html/libs/framework/base/CApplication.php(406): CWebApplication->getComponent()
#8 /home/fundasha/public_html/libs/framework/db/ar/CActiveRecord.php(589): CWebApplication->getDb()
#9 /home/fundasha/public_html/libs/framework/db/ar/CActiveRecord.php(2167): Proposals->getDbConnection()
#10 /home/fundasha/public_html/libs/framework/db/ar/CActiveRecord.php(353): CActiveRecordMetaData->__construct()
#11 /home/fundasha/public_html/libs/framework/web/CActiveDataProvider.php(63): model()
#12 /home/fundasha/public_html/protected/controllers/SiteController.php(62): CActiveDataProvider->__construct()
#13 /home/fundasha/public_html/libs/framework/web/actions/CInlineAction.php(57): SiteController->actionIndex()
#14 /home/fundasha/public_html/libs/framework/web/CController.php(300): CInlineAction->run()
#15 /home/fundasha/public_html/libs/framework/web/CController.php(278): SiteController->runAction()
#16 /home/fundasha/public_html/libs/framework/web/CController.php(257): SiteController->runActionWithFilters()
#17 /home/fundasha/public_html/libs/framework/web/CWebApplication.php(324): SiteController->run()
#18 /home/fundasha/public_html/libs/framework/web/CWebApplication.php(121): CWebApplication->runController()
#19 /home/fundasha/public_html/libs/framework/base/CApplication.php(135): CWebApplication->processRequest()
#20 /home/fundasha/public_html/index.php(13): CWebApplication->run()

1 个答案:

答案 0 :(得分:3)

听起来您没有在服务器上启用PHP PDO扩展: http://php.net/manual/en/book.pdo.php

Yii附带requirement checker script,您可以使用它来确保新主机符合Yii要求(在Yii库目录的requirements目录中)。 URL将是这样的:
http://hostname/path/to/yii/requirements/index.php