{dede:php} 空白,使用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中查找

functionkeepUser()

大概在281行,把keepUser()函数下的 @session_register(); 整段注释掉(删除也可以),结果如下:

functionkeepUser()

{

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();

return1;

}

else

{

return-1;

}

}

另外的解决方法就是在include/userlogin.class.php 中声明一个函数

functionsession_register()

{

returntrue;

}

bcfdaf186977d739f0409bfbd0a3c4a0.gif

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值