我正在为用PHP编写的一些集成工作设置现有站点,但每当我尝试启动管理控制台时,我都会得到:
警告: require_once(DIR_FS_SITE_CONTROL_INCLUDEScontrol_header.php) [function.require-once]:失败了 open stream:没有这样的文件或目录 在 C:\ WAMP \ WWW \反射营养\ website_control \的index.php 在第21行
任何人都可以指出我正确的方向来解决这个问题吗?
干杯
贾斯汀
的 的 *编辑* * **
这是我的index.php你能告诉我应该把这个定义放在哪里吗?
<? require_once("../includes/configure.php");
set_time_limit(1800);
require_once(DIR_FS_SITE_CONTROL."includes/admin_configure.php");
if($Page !="")
{
if(file_exists(DIR_FS_SITE_CONTROL_ADMINSCRIPT.$Page.".php"))
{
if(in_array($Page,$PagePermissionArray) || in_array("*",$PagePermissionArray))
require_once(DIR_FS_SITE_CONTROL_ADMINSCRIPT.$Page.".php");
}
}
if(@$_REQUEST['Meta'] !="false")
require_once(DIR_FS_SITE_CONTROL_INCLUDES."control_meta.php");
?>
<body leftmargin="0" rightmargin="0" marginwidth="0" topmargin="3" marginheight="3">
<?php
if(@$_REQUEST['Popup'] !="true")
require_once(DIR_FS_SITE_CONTROL_INCLUDES."control_header.php");
?>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="" align="center" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="98%">
<tr>
<td valign="top" align="center" style="padding-top:6px;">
<?
if(session_is_registered("InfoMessage") && $_SESSION['InfoMessage'] !="")
{
?> <table cellpadding="3" cellspacing="2" border="0" align="center" class="InsideTable">
<tr>
<td valign="middle" width="20"><img src="<?=DIR_WS_SITE_CONTROL_IMAGES?>info.png"></td>
<td><font color="Red"><b><?=$_SESSION['InfoMessage']?></b></font></td>
</tr>
</table>
<br>
<? $_SESSION['InfoMessage']="";
}
elseif(session_is_registered("ErrorMessage") && $_SESSION['ErrorMessage'] !="")
{
?> <table cellpadding="3" cellspacing="2" border="0" align="center" class="InsideTable">
<tr>
<td valign="middle" width="20"><img src="<?=DIR_WS_SITE_CONTROL_IMAGES?>error.png"></td>
<td><font color="Red"><b><?=$_SESSION['ErrorMessage']?></b></font></td>
</tr>
</table>
<br>
<? $_SESSION['ErrorMessage']="";
}
?>
<!-------Start Here --------->
<? if($Page !="")
{
if(file_exists(DIR_FS_SITE_CONTROL_FORMS.$Page.".php"))
{
if(in_array($Page,$PagePermissionArray) || in_array("*",$PagePermissionArray))
require_once(DIR_FS_SITE_CONTROL_FORMS.$Page.".php");
else
echo"<b>You do not have permission to access the page.</b>";
}
else
{
echo"<b>Page is under construction.</b>";
}
}
else
{
echo " ";
} ?>
<!-------End Here--------->
</td>
</tr>
</table>
</td>
</tr>
</table>
<?
if(@$_REQUEST['Popup'] !="true")
require_once(DIR_FS_SITE_CONTROL_INCLUDES."control_footer.php");?>
<script type="text/javascript">
function InitCall()
{
$.ajax({
type: "GET",
url: "index.php",
data: "",
success: function(msg){
}
});
setTimeout('InitCall()', 600000);
}
InitCall();
</script>
<?
$sk_timeend = explode(' ', microtime() );
$sk_timeend = $sk_timeend[1] + $sk_timeend[0];
echo "<!--".number_format($sk_timeend-$sk_timestart,3)."-->";
?>
</body>
</html>
<? //@mysql_close();
ob_end_flush();
?>
感谢
答案 0 :(得分:1)
可能的问题:
DIR_FS_SITE_CONTROL_INCLUDES
是常量,那么您没有定义它或在require_once()
或者您想要执行以下操作:
require_once(DIR_FS_SITE_CONTROL_INCLUDES . '/control_header.php');
答案 1 :(得分:1)
在您定义之前,您似乎尝试访问常量DIR_FS_SITE_CONTROL_INCLUDES
。
在您的情况下,常量似乎设置为子文件夹includes
。所以你可以通过
define('DIR_FS_SITE_CONTROL_INCLUDES', dirname(__FILE__) . '/includes/');
或
define('DIR_FS_SITE_CONTROL_INCLUDES', './includes/');
或PHP 5.3
define('DIR_FS_SITE_CONTROL_INCLUDES', __DIR__ . '/includes/');
答案 2 :(得分:0)
您需要连接常量和字符串:
require_once(DIR_FS_SITE_CONTROL_INCLUDES . 'control_header.php');