640X60广告位招租 qq245909083

dedecms织梦后台500错误空白的解决方法

分享时间:2017-12-16 690 热度℃
主要原为是php5.4的版本废除了session_register函数
@session_register($this->keepUserIDTag);
这种代码在PHP5.3以上版本直接报Fatal error错误。
可以采用以下方式:
$_SESSION[$this->keepUserIDTag] = $this->userID;
这种方式处理完整代码如下
首先打开 include/userlogin.class.php这个文件,在287行到308行:
  1. @session_register($this->keepUserIDTag);
  2. $_SESSION[$this->keepUserIDTag] = $this->userID;
  3. @session_register($this->keepUserTypeTag);
  4. $_SESSION[$this->keepUserTypeTag] = $this->userType;
  5. @session_register($this->keepUserChannelTag);
  6. $_SESSION[$this->keepUserChannelTag] = $this->userChannel;
  7. @session_register($this->keepUserNameTag);
  8. $_SESSION[$this->keepUserNameTag] = $this->userName;
  9. @session_register($this->keepUserPurviewTag);
  10. $_SESSION[$this->keepUserPurviewTag] = $this->userPurview;
  11. @session_register($this->keepAdminStyleTag);
  12. $_SESSION[$this->keepAdminStyleTag] = $adminstyle;
  13. PutCookie('DedeUserID', $this->userID, 3600 * 24, '/');
  14. PutCookie('DedeLoginTime', time(), 3600 * 24, '/');
复制代码

替换成
  1. //@session_register($this->keepUserIDTag);
  2. $_SESSION[$this->keepUserIDTag] = $this->keepUserIDTag;
  3. $_SESSION[$this->keepUserIDTag] = $this->userID;
  4. //@session_register($this->keepUserTypeTag);
  5. $_SESSION[$this->keepUserTypeTag] = $this->keepUserTypeTag;
  6. $_SESSION[$this->keepUserTypeTag] = $this->userType;
  7. // @session_register($this->keepUserChannelTag);
  8. $_SESSION[$this->keepUserChannelTag] = $this->keepUserChannelTag;
  9. $_SESSION[$this->keepUserChannelTag] = $this->userChannel;
  10. //@session_register($this->keepUserNameTag);
  11. $_SESSION[$this->keepUserNameTag] = $this->keepUserNameTag;
  12. $_SESSION[$this->keepUserNameTag] = $this->userName;
  13. //@session_register($this->keepUserPurviewTag);
  14. $_SESSION[$this->keepUserPurviewTag] = $this->keepUserPurviewTag;
  15. $_SESSION[$this->keepUserPurviewTag] = $this->userPurview;
  16. // @session_register($this->keepAdminStyleTag);
  17. $_SESSION[$this->keepAdminStyleTag] = $this->keepAdminStyleTag;
  18. $_SESSION[$this->keepAdminStyleTag] = $adminstyle;
  19. PutCookie(‘DedeUserID’, $this->userID, 3600 * 24, ‘/’);
  20. PutCookie(‘DedeLoginTime’, time(), 3600 * 24, ‘/’);
复制代码
返回顶部