這篇文章主要介紹了DedeCMS不支援PHP5.3、5.4以上版本後台500錯誤白屏的解決方法,需要的朋友可以參考下
dedecms模板下載地址: m.sbmmt.com/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中文網其他相關文章!