找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1103|回复: 0

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

[复制链接]
发表于 2018-7-3 07:41:46 | 显示全部楼层 |阅读模式 来自 中国–河南–新乡
今天把系统换成了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行原内容如下:

  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. if(empty($adminstyle)) $adminstyle = ‘dedecms’;
  2. //@session_register($this->keepUserIDTag);
  3. $_SESSION[$this->keepUserIDTag] = $this->keepUserIDTag;
  4. $_SESSION[$this->keepUserIDTag] = $this->userID;
  5. //@session_register($this->keepUserTypeTag);
  6. $_SESSION[$this->keepUserTypeTag] = $this->keepUserTypeTag;
  7. $_SESSION[$this->keepUserTypeTag] = $this->userType;
  8. // @session_register($this->keepUserChannelTag);
  9. $_SESSION[$this->keepUserChannelTag] = $this->keepUserChannelTag;
  10. $_SESSION[$this->keepUserChannelTag] = $this->userChannel;
  11. //@session_register($this->keepUserNameTag);
  12. $_SESSION[$this->keepUserNameTag] = $this->keepUserNameTag;
  13. $_SESSION[$this->keepUserNameTag] = $this->userName;
  14. //@session_register($this->keepUserPurviewTag);
  15. $_SESSION[$this->keepUserPurviewTag] = $this->keepUserPurviewTag;
  16. $_SESSION[$this->keepUserPurviewTag] = $this->userPurview;
  17. // @session_register($this->keepAdminStyleTag);
  18. $_SESSION[$this->keepAdminStyleTag] = $this->keepAdminStyleTag;
  19. $_SESSION[$this->keepAdminStyleTag] = $adminstyle;
  20. PutCookie(‘DedeUserID’, $this->userID, 3600 * 24, ‘/’);
  21. PutCookie(‘DedeLoginTime’, time(), 3600 * 24, ‘/’);
复制代码

发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;

如何回报帮助你解决问题的坛友,好办法就是点击帖子下方的评分按钮给对方加【金币】不会扣除自己的积分,做一个热心并受欢迎的人!

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则 需要先绑定手机号

关闭

站长推荐上一条 /1 下一条

QQ|侵权投诉|广告报价|手机版|小黑屋|西部数码代理|飘仙建站论坛 ( 豫ICP备2022021143号-1 )

GMT+8, 2025-1-10 10:04 , Processed in 0.044401 second(s), 8 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表