• 全国400电话网上服务平台
    强大号码库资源任选,方便,快捷,快速开通。
    咨询热线:400-1100-266  

    DedeCMS不支持PHP5.3、5.4及以上版本后台500错误白屏的解决方法
    POST TIME:2021-05-24 03:08

    今天把系统换成了windows server 2008 r2 同时将PHP环境提升至PHP5.7版本,测试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, ‘/’);

    
    关于我们 | 付款方式 | 建站知识 | 增值服务 | 网站模板
    Copyright © 2003-2016
    时间:9:00-21:00 (节假日不休)
    版权所有:巨人网络(扬州)科技有限公司
    总部地址:江苏省信息产业基地11号楼四层
    《增值电信业务经营许可证》 苏B2-20120278
    X

    截屏,微信识别二维码

    微信号:veteran88

    (点击微信号复制,添加好友)

     打开微信

    微信号已复制,请打开微信添加咨询详情!