究其原因,是由于dedecms暂不支持php5.4.3引发的问题。
下面来开始本节dedecms 教程的内容吧。
解决方法如下:
找include/userlogin.class.php里面的keepuser()函数,
把@session_register 全部改写。
把@session_register($this->keepUserIDTag); 注释掉,改为:
if (!isset($_SESSION[$this->keepUserIDTag]))
全部六个,如下所示:
//@session_register($this->keepUserIDTag); if (!isset($_SESSION[$this->keepUserIDTag])) $_SESSION[$this->keepUserIDTag] = $this->userID; //@session_register($this->keepUserTypeTag); if (!isset($_SESSION[$this->keepUserTypeTag])) $_SESSION[$this->keepUserTypeTag] = $this->userType; //@session_register($this->keepUserChannelTag); if (!isset($_SESSION[$this->keepUserChannelTag])) $_SESSION[$this->keepUserChannelTag] = $this->userChannel; //@session_register($this->keepUserNameTag); if (!isset($_SESSION[$this->keepUserNameTag])) $_SESSION[$this->keepUserNameTag] = $this->userName; //@session_register($this->keepUserPurviewTag); if (!isset($_SESSION[$this->keepUserPurviewTag])) $_SESSION[$this->keepUserPurviewTag] = $this->userPurview; //@session_register($this->keepAdminStyleTag); if (!isset($_SESSION[$this->keepAdminStyleTag])) $_SESSION[$this->keepAdminStyleTag] = $adminstyle;
修改完毕,即可正常登录dedecms后台了。
解释:
php5.4移除了session_register函数,继续使用该函数会产生错误。
要修改为:
if (!isset($_SESSION[$this->keepUserTypeTag]))
才可以的。