栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP > php开源框架 > dedecms

使用phpstudy时dedecms后台页面空白解决方法(PHP版本原

dedecms 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

使用phpstudy时dedecms后台页面空白解决方法(PHP版本原

今天把电脑上的phpStudy升级到2013版。在登录本地织梦dedecms5.7时,/dede/login.php居然显示空白。由于周五我安装了windows8,因为是电脑问题,等我关掉防火墙配置好电脑服务后,发现还是不行。在百度后终于得到高人的日志指点。 原因很简单,phpstudy2013版是用的php5.4,而dedecms的login.php中使用了一个被php5.4抛弃不用的函数(是不是真的抛弃我不知道,反正原文这么写的) session_register() 意思就是这说个函数不能用了,想用也用不了。方法很简单,直接注释掉,不用进行注册就可以声明session。 在dedecms目录include/userlogin.class.php中查找 function keepUser()  大概在281行,把keepUser()函数下的 @session_register(); 整段注释掉(删除也可以),结果如下: function keepUser()    {    if($this->userID != '' && $this->userType != '')    {    global $admincachefile,$adminstyle;    if(emptyempty($adminstyle)) $adminstyle = 'dedecms';      //@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, '/');      $this->ReWriteAdminChannel();      return 1;    }    else    {    return -1;    }    }    另外的解决方法就是在include/userlogin.class.php 中声明一个函数 function session_register()    {   return true;   }  

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/4627.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号