新聞中心
dedecms在php5.4環(huán)境下登錄后臺(tái)或者退出后臺(tái)報(bào)錯(cuò)或者顯示頁面找不到的問題解決
目前好多的空間商都針對(duì)于php版本進(jìn)行升級(jí)了,目前無憂主機(jī)的php空間的php版本有5.2、5.3、5.4 、5.6、7.0 ,那么dedecms源碼程序可以在5.2和5.3完美的運(yùn)行幾乎是沒有出現(xiàn)啥問題,而今天無憂主機(jī)在接待售后的時(shí)候發(fā)現(xiàn)一位站長朋友找到我們,說是登錄后臺(tái)上不去,于是乎截圖給無憂主機(jī)小編查看,如圖1所示:
從該圖中可以查看這個(gè)并不是頁面找不到的問題,而是500問題的錯(cuò)誤,那么出現(xiàn)這樣的錯(cuò)誤只有兩種可能性,一個(gè)是文件的權(quán)限問題,但是文件的權(quán)限問題不會(huì)出現(xiàn)這樣的提示的,還有一個(gè)就是配置的問題。那么這位朋友的這個(gè)站點(diǎn)之前是可以完美的運(yùn)行的,所以出現(xiàn)這樣的問題肯定是程序的方面的問題。
于是無憂主機(jī)小編就百度了一下,確實(shí)出現(xiàn)這樣的問題還真的不少,有的是白屏,有的是無法運(yùn)行,總之就是在登錄后臺(tái)這里出現(xiàn)的問題,經(jīng)過相關(guān)的資料發(fā)現(xiàn):session_register()和session_unregister()函數(shù)已經(jīng)在php5.4版本中被廢棄了,所以就會(huì)出現(xiàn)以上問題的情況,找到問題我們就好辦了。
首先是進(jìn)入到的我們的會(huì)員中心--主機(jī)管理--控制面板--文件管理。
然后進(jìn)入到根目錄找到include/userlogin.class.php,如圖2所示:
找到之后點(diǎn)擊編輯,查找如下代碼:
@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, '/');如圖3所示: 將這些代碼中的session_register函數(shù)給刪除掉即可或者使用//進(jìn)行注釋。
![3](http://m.gle-technology.com/wp-content/uploads/2017/08/34-300x239.png)
![4](http://m.gle-technology.com/wp-content/uploads/2017/08/41-300x208.png)
@session_unregister($this->keepUserIDTag); @session_unregister($this->keepUserTypeTag); @session_unregister($this->keepUserChannelTag); @session_unregister($this->keepUserNameTag); @session_unregister($this->keepUserPurviewTag);如圖5所示:
![5](http://m.gle-technology.com/wp-content/uploads/2017/08/5-300x223.png)
unset($this->keepUserIDTa); unset($this->keepUserTypeTag); unset($this->keepUserChannelTa); unset($this->keepUserNameTag); unset($this->keepUserPurviewTag);如圖6所示:
![6](http://m.gle-technology.com/wp-content/uploads/2017/08/6-300x198.png)
本文地址:http://m.gle-technology.com/dedecms/25296.html
![1](/wp-content/themes/starow_z/img/o-1.png)
![1](/wp-content/themes/starow_z/img/o-2.png)
![1](/wp-content/themes/starow_z/img/o-3.png)
![1](/wp-content/themes/starow_z/img/o-4.png)
![1](/wp-content/themes/starow_z/img/o-5.png)
![1](/wp-content/themes/starow_z/img/o-6.png)
![1](/wp-content/themes/starow_z/img/o-7.png)