在把 phpStudy升級到2013版后,在登錄本地織夢dedecms5.7時,/dede/login.php居然顯示空白。下面分享下解決辦法。
原因很簡單,phpstudy2013版是用的php5.4,而dedecms的login.php中使用了一個被php5.4拋棄不用的函數(是不是真的拋棄我不知道,反正原文這么寫的)
session_register()
意思就是這說個函數不能用了,想用也用不了。方法很簡單,直接注釋掉,不用進行注冊就可以聲明session。
在dedecms目錄include/userlogin.class.php中查找
function keepUser()
大概在281行,把keepUser()函數下的 @session_register(); 整段注釋掉(刪除也可以),結果如下:
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 中聲明一個函數
function session_register() { return true; }以上就是使用phpstudy搭建dedecms網站后臺頁面空白解決方法的全部內容,希望對大家的學習和解決疑問有所幫助,也希望大家多多支持武林網。新聞熱點
疑難解答