今天把电脑上的phpStudy升级到2013版。在登录本地织梦dedecms5.7时,/dede/login.php居然显示空白。由于周五我安装了windows8,因为是电脑问题,等我关掉防火墙配置好电脑服务后,发现还是不行。在百度后终于得到高人的日志指点。 p.)G ],
原因很简单,phpstudy2013版是用的php5.4,而dedecms的login.php中使用了一个被php5.4抛弃不用的函数(是不是真的抛弃我不知道,反正原文这么写的) 'xhX\?mD
session_register() ` O-$qT,_
意思就是这说个函数不能用了,想用也用不了。方法很简单,直接注释掉,不用进行注册就可以声明session。 qpFFvZ
W
在dedecms目录include/userlogin.class.php中查找 c1Xt$[_
function keepUser() 5_#wOz0u$
大概在281行,把keepUser()函数下的 @session_register(); 整段注释掉(删除也可以),结果如下: l\JoWL
function keepUser() u+kXJ
{ y.HE3tH
if($this->userID != '' && $this->userType != '') vA*!82
{ &dH/V-te
global $admincachefile,$adminstyle; 5F18/:\n
if(emptyempty($adminstyle)) $adminstyle = 'dedecms'; glm29hF
+' QX`
//@session_register($this->keepUserIDTag); /z.Y<xOc
$_SESSION[$this->keepUserIDTag] = $this->userID; !X*+Ct^
RQ;pAO
//@session_register($this->keepUserTypeTag); <j+DY@*
$_SESSION[$this->keepUserTypeTag] = $this->userType; IVjH.BzH9
|#^wYZO1U
//@session_register($this->keepUserChannelTag); 4V@raI-
$_SESSION[$this->keepUserChannelTag] = $this->userChannel; @GNNi?EY
>hHjDYjbf
//@session_register($this->keepUserNameTag); d"`/P?nx
$_SESSION[$this->keepUserNameTag] = $this->userName; Uus%1hC%a
Xn@\p5<
// @session_register($this->keepUserPurviewTag); @-qS[bV
$_SESSION[$this->keepUserPurviewTag] = $this->userPurview; `K5Lp>=R
7)SG#|v[$
//@session_register($this->keepAdminStyleTag); JcV'O)&
$_SESSION[$this->keepAdminStyleTag] = $adminstyle; -!V+>.Oh
I8~ .Vu2
PutCookie('DedeUserID', $this->userID, 3600 * 24, '/'); H2[VZ&Pg
PutCookie('DedeLoginTime', time(), 3600 * 24, '/'); *9Ta0e*
$1lI6 =
,
$this->ReWriteAdminChannel(); +5~5BZP
0i/!by{@
return 1; v3\
|
} T<XGG_NOl
else y950Q%B]
{ H#/ #yVw
return -1; oW
! Z=;
} j}s<Pn%4
} s|HpN
另外的解决方法就是在include/userlogin.class.php 中声明一个函数