首页 教程资源正文

解决DedeCMS不支持PHP5.3、5.4及以上版本后台500错误白屏的方法

娜迦源码 教程资源 2019-04-07 01:29:57 295 0 教程资源

今天把系统换成了windows server 2008 r2 同时将PHP环境提升至PHP5.5版本,测试PHPinfo的时候一点问题都没有,但是登陆dede后台却显示500错误,这应该怎么解决呢?百度了一下发现dede不支持PHP5.3、PHP5.4及以上版本了,主要原为是php5.4的版本废除了session_register函数 
可以采用如$_SESSION[$this->keepUserIDTag] = $this->userID; 

这种方式处理完整代码如下 
首先打开 include/userlogin.class.php这个文件,在287行到308行原内容如下: 

复制代码 
代码如下: 

@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, ‘/’); 

替换成 

复制代码 
代码如下: 

if(empty($adminstyle)) $adminstyle = ‘dedecms’; 
//@session_register($this->keepUserIDTag); 
$_SESSION[$this->keepUserIDTag] = $this->keepUserIDTag; 
$_SESSION[$this->keepUserIDTag] = $this->userID; 
//@session_register($this->keepUserTypeTag); 
$_SESSION[$this->keepUserTypeTag] = $this->keepUserTypeTag; 
$_SESSION[$this->keepUserTypeTag] = $this->userType; 
// @session_register($this->keepUserChannelTag); 
$_SESSION[$this->keepUserChannelTag] = $this->keepUserChannelTag; 
$_SESSION[$this->keepUserChannelTag] = $this->userChannel; 
//@session_register($this->keepUserNameTag); 
$_SESSION[$this->keepUserNameTag] = $this->keepUserNameTag; 
$_SESSION[$this->keepUserNameTag] = $this->userName; 
//@session_register($this->keepUserPurviewTag); 
$_SESSION[$this->keepUserPurviewTag] = $this->keepUserPurviewTag; 
$_SESSION[$this->keepUserPurviewTag] = $this->userPurview; 
// @session_register($this->keepAdminStyleTag); 
$_SESSION[$this->keepAdminStyleTag] = $this->keepAdminStyleTag; 
$_SESSION[$this->keepAdminStyleTag] = $adminstyle; 
PutCookie(‘DedeUserID’, $this->userID, 3600 * 24, ‘/’); 
 PutCookie(‘DedeLoginTime’, time(), 3600 * 24, ‘/’);

版权声明

1:如非特殊说明,本站对提供的源码不拥有任何权利,其版权归原著者拥有。

2:请勿将该源码、软件进行商业交易、转载等行为,该源码、软件只为研究、学习所提供,该软件使用后发生的一切问题与本站无关。

3:本网站所有源码和软件均为作者提供和网友推荐收集整理而来,仅供学习和研究使用。如有侵犯你版权的,请来信(邮箱:393249296@qq.com)指出,本站将立即改正。

本文链接:https://www.wsx6.cn/post/1060.html

分享:

支付宝

微信

嘿,我是客服
请先 登录 再评论,若不是会员请先 注册