原文来自:https://www.zixuephp.com

DEDECMS后台登陆后显示空白页解决办法——PHP5.4环境下

登陆DEDECMS后台输入用户名和密码后没有提示显示为空白,主要原因是php5.4的版本删除了session_register函数,打开文件include/userlogin.class.php在 function keepUser()内把如下代码:

  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. //替换成
  14. $_SESSION[$this->keepUserIDTag]=$this->userID;
  15. $_SESSION[$this->keepUserTypeTag]=$this->userType;
  16. $_SESSION[$this->keepUserChannelTag]=$this->userChannel;
  17. $_SESSION[$this->keepUserNameTag]=$this->userName;
  18. $_SESSION[$this->keepUserPurviewTag]=$this->userPurview;
  19. $_SESSION[$this->keepAdminStyleTag]=$adminstyle;

即把每个包含@session_register的语句删除,即可以解决该问题,或者换成其他版本的php.