我正在经历一个php project
. 由于客户需要在设计部分进行一些更改,我已将所有文件和数据库下载到我的本地主机(LAMP)。我已将数据库导入到我的 phpmyadmin。之后,我对提到数据库用户名和密码的必要文件进行了更改。现在,当我从浏览器浏览该站点时,出现此错误
Notice: Use of undefined constant session - assumed 'session' in project/session.php
之后,我刚刚打开了session.php
错误所在的文件。该文件的代码类似于这样
<?php
session_start();
$_SESSION['example']="yes";
ini_set("url_rewriter.tags","");
ini_set(session.use_trans_sid, false);
ini_set("session.cookie_domain", ".projectsite.com");
ob_start();
session_start();
$_session_register["esb2b_username"];
$_session_register["esb2b_userid"];
$_session_register["esb2b_memtype"];
$_session_register["esb2b_adv_id"];
$_session_register["esb2b_adv_email"];
$_session_register["lang"];
?>
我刚刚评论了这条线ini_set(session.use_trans_sid, false);
,但我仍然收到错误消息。那么有人可以告诉我如何解决这个错误吗?任何帮助和建议都将是非常可观的。谢谢
更新 现在我已经像这样更改了我的文件
<?php
if(!isset($_SESSION)) {
session_start();
$_SESSION['example']="yes";
ini_set("url_rewriter.tags","");
ini_set("session.use_trans_sid", 0);
ini_set("session.cookie_domain", ".projectsite.com");
ob_start();
$_session_register["esb2b_username"];
$_session_register["esb2b_userid"];
$_session_register["esb2b_memtype"];
$_session_register["esb2b_adv_id"];
$_session_register["esb2b_adv_email"];
$_session_register["lang"];
}
?>
在此之后我的错误说像
Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in project/session.php on line 6 Notice: Undefined variable: _session_register in /project/session.php on line 10 Notice: Undefined variable: _session_register in project/session.php on line 11 Notice: Undefined variable: _session_register in project/session.php on line 12 Notice: Undefined variable: _session_register in project/session.php on line 13 Notice: Undefined variable: _session_register in project/session.php on line 14 Notice: Undefined variable: _session_register in project/session.php on line 15