phpwind的一个问题

zoro1101 2014-04-27 06:59:09
我把客户的一个服务器A上的一个phpwind的网站转移到另一个服务器B上,网站使用的是iis6+mysql+phpwind
搬迁过程:
1.把数据库的文件的myi,myd,frm,还有db.opt全部移到B,数据库连接没问题.
2.把网站复制过来,配置好,打开出现500
3.加了一些调试代码在网页上面,发现崩溃的堆栈应该是这样的:
index.php require_once ('global.php');
|- global.php ACloud_App_Guiding::runApps(SCR);
|--aCloud.php ACloud_Init::execute ();
|---aCloud.php ACloud_Sys_Core_Common::setGlobal ( 'g_siteurl', ACLOUD_APPLY_SITEURL ? ACLOUD_APPLY_SITEURL : $_extrasService->getExtra ( 'ac_apply_siteurl' ) );
|----$extra = $this->_getExtra ( $key ); //在这边发现是因为没有读到那个key导致的,然后去找获取key的地方

看到$_extrasService = ACloud_Sys_Core_Common::loadSystemClass ( 'extras', 'config.service' );之后,从下面的代码发现,这个像是插件模式:
function loadSystemClass($className, $module = 'core') {
static $classes = array ();
$class = sprintf ( "ACloud_Sys_%s", str_replace ( ".", "_", $module . '.' . $className ) );
if (isset ( $classes [$class] ))
return $classes [$class];
$classPath = sprintf ( ACLOUD_PATH . "/system/%s/sys.%s.%s.php", str_replace ( ".", "/", $module ), $module, $className );
if (! is_file ( $classPath ))
ACloud_Sys_Core_Common::showError ( 'cann`t find classpath' );
require_once ACloud_Sys_Core_S::escapePath ( $classPath );
if (! class_exists ( $class ))
ACloud_Sys_Core_Common::showError ( 'cann`t find class' );
$classes [$class] = new $class ();
return $classes [$class];
}
应该是调用通过文件名找过去的,
应该是request了sys.config.service.extras.php这个文件,发现了getExtra
function _getExtra($key) {
$extrasDao = $this->getExtrasDao ();
return $extrasDao->get ( $key );
}
贴上getExtrasDao的代码:
function getExtrasDao() {
return ACloud_Sys_Core_Common::loadSystemClass ( 'extras', 'config.dao' );
}
同样道理,找到sys.config.dao.extras.php这个文件,贴上get方法:
function get($ekey) {
if (! $this->checkTable ())
return array ();
return $this->fetchOne ( sprintf ( "SELECT * FROM %s WHERE ekey = %s", $this->tablename, ACloud_Sys_Core_S::sqlEscape ( $ekey ) ) );
}
最后发现crash是发生在$this->checkTable ()的时候,最后贴上checkTable的代码:
function checkTable() {
static $tableStatus = null;
if (null === $tableStatus) {
//!!crash
$result = $this->fetchOne ( "SHOW TABLES LIKE '" . $this->tablename . "'" );
$tableStatus = ($result) ? true : false;
}
return $tableStatus;
}
经过加调试代码发现,问题确实出在: $result = $this->fetchOne ( "SHOW TABLES LIKE '" . $this->tablename . "'" );上面
但是不解的是,我明明数据库有设置,但是取不出来..这是为毛..而且可以确定,数据库连接配置是正确的,而且数据库里面确定是有这个表,mysql命令行下面可以成功的select出来
因为是别人的帮忙,所以只能看到这儿了..网上查了编码什么的问题..稀里糊涂的没看懂,而且phpwind的个蛋疼的官方还搞了个邀请码(吐槽吐槽),所以没法发到那上面去..只能在这边求助了..问题的思路我应该描述的非常详细了..恳请大虾们出招..
ps: 分数可以加的..就怕没人来回答...
...全文
202 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

4,250

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧