安裝了Dedecms之后,登錄到后臺(tái),輸入用戶名和密碼之后,頁面就變成了空白,也不會(huì)跳轉(zhuǎn)到index.php頁面。在網(wǎng)上搜索了一下,發(fā)現(xiàn)有些文章介紹是因?yàn)樾薷牧薸nclude/common.inc.php和dede/config.php引起的。使用文本編輯器,發(fā)現(xiàn)也沒有所謂的BOM問題。
有查了一下,發(fā)現(xiàn)PHP環(huán)境為PHP 5.4.22,而Dedecms 5.7最好是在PHP 5.3下使用,一些函數(shù)在PHP 5.4下已經(jīng)廢棄,導(dǎo)致了一些問題。
解決DedeCMS 5.7登錄后臺(tái)空白的解決辦法:
打開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了。
相關(guān)文章:DedeCMS 5.7不兼容PHP 5.4版本的解決辦法