这篇文章主要为大家详细介绍了使用phpstudy搭建dedecms网站后台页面空白解决方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下,有需要的朋友可以收藏方便以后借鉴。
在把 phpStudy升级到版后,在登录本地织梦dedecms5.7时,/dede/login.php居然显示空白。下面分享下解决办法。
原因很简单,phpstudy版是用的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;
}
以上就是使用phpstudy搭建dedecms网站后台页面空白解决方法的全部内容,希望对大家的学习和解决疑问有所帮助,也希望大家多多支持361模板网。
感谢打赏,我们会为大家提供更多优质资源!