当我在具有新域的另一个托管服务器上转移站点时,出现此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()
解决方法:
听起来您没有在服务器上启用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
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。