DedeCMS 5.7登錄后臺空白的解決辦法

2015-10-20 21:07:39來源:威易網作者:icech

安裝了Dedecms之后,登錄到后臺,輸入用戶名和密碼之后,頁面就變成了空白,也不會跳轉到index.php頁面。在網上搜索了一下,發(fā)現有些文章介紹是因為修改了include/common.inc.php和dede/config.php引起的。使用文本編輯器,發(fā)現也沒有所謂的BOM問題。

安裝了Dedecms之后,登錄到后臺,輸入用戶名和密碼之后,頁面就變成了空白,也不會跳轉到index.php頁面。在網上搜索了一下,發(fā)現有些文章介紹是因為修改了include/common.inc.php和dede/config.php引起的。使用文本編輯器,發(fā)現也沒有所謂的BOM問題。

有查了一下,發(fā)現PHP環(huán)境為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