織夢(mèng)dedecms現(xiàn)在憑借著使用簡(jiǎn)單模板眾多的好處,仍然有非常多的站長(zhǎng)仍然繼續(xù)使用這,今天來(lái)說(shuō)下新安裝的織夢(mèng)dedecms5.7進(jìn)入后臺(tái)就報(bào)錯(cuò)500錯(cuò)誤的解決方法。

織夢(mèng)dedecm5.7安裝后進(jìn)入后臺(tái)出現(xiàn)500錯(cuò)誤
織夢(mèng)dedecms登錄后臺(tái)出現(xiàn)500錯(cuò)誤,可以在服務(wù)器上面把PHP的版本修改為5.2或者5.3,因?yàn)榉?wù)器php運(yùn)行環(huán)境如果使用的是5.4版本的話,dedecms的login.php中使用了一個(gè)被php5.4拋棄的函數(shù),所以會(huì)在登錄后臺(tái)的時(shí)候報(bào)錯(cuò)500,如果不想降低php版本號(hào),可以刪除在dedecms目錄include/userlogin.class.php中查找
function keepUser()
大概在281行,把keepUser()函數(shù)下的 @session_register(); 整段注釋掉(刪除也可以),結(jié)果如下:
function keepUser()
{
if($this->userID != '' && $this->userType != '')
{
global $admincachefile,$adminstyle;
if(emptyempty($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
{
return -1;
}
}
另外的解決方法就是在include/userlogin.class.php 中聲明一個(gè)函數(shù)
function session_register()
{
return true;
}
以上就是新安裝的織夢(mèng)dedecms5.7進(jìn)入后臺(tái)報(bào)500錯(cuò)誤的解決方法,希望對(duì)各位有所幫助