站长之家 - 站长资讯 - 易采站长站

当前位置: > 建站教程 > 源码教程 > CMS 教程 >

DedeCMS 5.7不兼容PHP 5.4版本的解决办法-DedeCms教程

2019-10-15 13:47 | 来源:易采站长站 | 编辑:admin |

PHP 5.4相对与5.3的变化还是很大的,废除了不少原因的函数,这也导致了一些CMS无法完美支持的问题,比如DedeCMS系统。

在PHP 5.4下,登录DedeCMS后台输入用户名和密码后没有提示显示为空白,主要原为是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, ‘/’);

替换成

global $admincachefile,$adminstyle;

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

至此问题解决。

解决方法二:

找到include文件夹中的userlogin.class.php文件中把所有带有session_register的全部删除即可。

@session_register下的所有语句屏蔽掉

function keepUser()

{

if($this->userID != ” && $this->userType != ”)

{

global $admincachefile,$adminstyle;

if(empty($adminstyle)) $adminstyle = ‘dedecms’;

代码如下复制代码

$_SESSION[$this->keepAdminStyleTag] = $adminstyle;

PutCookie(‘DedeUserID’, $this->userID, 3600 * 24, ‘/’);

PutCookie(‘DedeLoginTime’, time(), 3600 * 24, ‘/’);

$this->ReWriteAdminChannel();

return 1;

}

else{….以下省略

软件名称:
DedeCms (织梦CMS)内容管理系统下载
软件语言:
简体/繁体中文
软件授权:
个人免费

  • dedecms实现任意页面调用当前会员信息的方法-DedeCms教程
  • 织梦DedeCMS5.7图集加水印解决方法-DedeCms教程
  • dedecms 5.7的后台验证码不显示的解决办法-DedeCms教程
  • DEDECMS后台无法登陆并跳转回登陆界面的解决方法-DedeCms教程
  • dedecms后台广告管理无法添加的解决办法-DedeCms教程
  • DedeCMS升级0715补丁出现“PHP 5.3 and above”错误的解决办法-DedeCms教程
  • DEDECMS列表页文档按权重排序的实现方法-DedeCms教程
  • 织梦DEDECMS微信插件如何跳转到DEDECMS自带手机端-DedeCms教程
  • DEDECMS修改默认搜索为百度站内搜索方法详解-DedeCms教程
  • 移动DedeCMS验证码无法正常显示的解决办法-DedeCms教程
  • 网友评论

    关于我们 - 联系我们 - 广告服务 - 版权声明 - 人才招聘 - 友情链接 - 网站地图 - 帮助 - -

    CopyRight © 2010-2016 源码下载 easck.com , All Rights Reserved

    蒙公网安备 15052402000103号

    蒙ICP备14002389-1号