詳解DedeCMS不支援PHP5.3、5.4以上版本後台500錯誤白屏的解決方法

黄舟
發布: 2023-03-07 08:12:02
原創
2585 人瀏覽過

這篇文章主要介紹了DedeCMS不支援PHP5.3、5.4以上版本後台500錯誤白屏的解決方法,需要的朋友可以參考下

dedecms模板下載地址: www.php.cn/xiazai/code/dedecms

今天把系統換成了windows server 2008 r2 同時將PHP環境提升至PHP5.5版本,測試PHPinfo的時候一點問題都沒有,但是登陸dede後台卻顯示500錯誤,這該怎麼解決呢?百度了一下發現dede不支援PHP5.3、PHP5.4以上版本了,主要原為是php5.4的版本廢除了session_register函數
可以採用如$_SESSION[$this->keepUserIDTag] = $this->userID;

這種方式處理完整程式碼如下
首先打開include/userlogin.class.php這個文件,在287行到308行原始內容如下:

程式碼如下:

@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; 
Put
Cookie
(‘DedeUserID’, $this->userID, 3600 * 24, ‘/’); 
PutCookie(‘DedeLogin
Time
’, time(), 3600 * 24, ‘/’);
登入後複製

取代成

程式碼如下:

if
(empty($adminstyle)) $adminstyle = ‘dedecms’; 
//@session_register($this->keepUserIDTag); 
$_SESSION[$this->keepUserIDTag] = $this->keepUserIDTag; 
$_SESSION[$this->keepUserIDTag] = $this->userID; 
//@session_register($this->keepUserTypeTag); 
$_SESSION[$this->keepUserTypeTag] = $this->keepUserTypeTag; 
$_SESSION[$this->keepUserTypeTag] = $this->userType; 
// @session_register($this->keepUserChannelTag); 
$_SESSION[$this->keepUserChannelTag] = $this->keepUserChannelTag; 
$_SESSION[$this->keepUserChannelTag] = $this->userChannel; 
//@session_register($this->keepUserNameTag); 
$_SESSION[$this->keepUserNameTag] = $this->keepUserNameTag; 
$_SESSION[$this->keepUserNameTag] = $this->userName; 
//@session_register($this->keepUserPurviewTag); 
$_SESSION[$this->keepUserPurviewTag] = $this->keepUserPurviewTag; 
$_SESSION[$this->keepUserPurviewTag] = $this->userPurview; 
// @session_register($this->keepAdminStyleTag); 
$_SESSION[$this->keepAdminStyleTag] = $this->keepAdminStyleTag; 
$_SESSION[$this->keepAdminStyleTag] = $adminstyle; 
PutCookie(‘DedeUserID’, $this->userID, 3600 * 24, ‘/’); 
PutCookie(‘DedeLoginTime’, time(), 3600 * 24, ‘/’);
登入後複製


以上是詳解DedeCMS不支援PHP5.3、5.4以上版本後台500錯誤白屏的解決方法的詳細內容。更多資訊請關注PHP中文網其他相關文章!

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板