今天家里的电脑上新装DEDE5.7后台登陆后竟然一片空白经过分析代码,发现登录验证的时候用到了这个函数session_register(我的环境:win7+PHP5.4.3+Apache2.2.22+mysql5.5.24),原来我的php版本是5.4.x版本的(),经过一系列的搜寻,发现这个函数在PHP5.4版本中已经被弃用了,已经被删除了。也就是这个函数不再可用了。直接注释掉就可以了,不用进行注册就可以声明session。
解决方法是:
找到include文件夹中的userlogin.class.php文件中
@session_register下的所有语句屏蔽掉。红色部分
function keepUser()
{
if($this->userID != ” && $this->userType != ”)
{
global $admincachefile,$adminstyle;
if(empty($adminstyle)) $adminstyle = ‘dedecms’;
/*@session_register($this->keepUserIDTag);*/
$_SESSION[$this->keepUserIDTag] = $this->userID;
/* @session_register($this->keepUserTypeTag);*/
$_SESSION[$this->keepUserTypeTag] = $this->userType;
/* @session_register($this->keepUserChannelTag);*/
$_SESSION[$this->keepUserChannelTag] = $this->userChannel;
/*@session_register($this->keepUserNameTag);*/
$_SESSION[$this->keepUserNameTag] = $this->userName;
/* @session_register($this->keepUserPurviewTag);*/
$_SESSION[$this->keepUserPurviewTag] = $this->userPurview;
/*@session_register($this->keepAdminStyleTag);*/
$_SESSION[$this->keepAdminStyleTag] = $adminstyle;
PutCookie(‘DedeUserID’, $this->userID, 3600 * 24, ‘/’);
PutCookie(‘DedeLoginTime’, time(), 3600 * 24, ‘/’);
$this->ReWriteAdminChannel();
return 1;
}
else{….以下省略