DedeCMS 5.7登录后台空白的解决办法

2015-10-20 21:07:39来源:威易网作者:icech

安装了Dedecms之后,登录到后台,输入用户名和密码之后,页面就变成了空白,也不会跳转到index.php页面。在网上搜索了一下,发现有些文章介绍是因为修改了include/common.inc.php和dede/config.php引起的。使用文本编辑器,发现也没有所谓的BOM问题。

安装了Dedecms之后,登录到后台,输入用户名和密码之后,页面就变成了空白,也不会跳转到index.php页面。在网上搜索了一下,发现有些文章介绍是因为修改了include/common.inc.php和dede/config.php引起的。使用文本编辑器,发现也没有所谓的BOM问题。

有查了一下,发现PHP环境为PHP 5.4.22,而Dedecms 5.7最好是在PHP 5.3下使用,一些函数在PHP 5.4下已经废弃,导致了一些问题。

解决DedeCMS 5.7登录后台空白的解决办法:

打开include/userlogin.class.php文件,找到function keepUser()

将代码修改为如下:

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

修改后保存,就OK了。

相关文章:DedeCMS 5.7不兼容PHP 5.4版本的解决办法

 

关键词:DedeCMS