开发者

PHP Warning: require_once(DIR_FS_SITE_CONTROL_INCLUDEScontrol_header.php)

开发者 https://www.devze.com 2023-03-14 15:16 出处:网络
I am setting up an existing site for some integration work written in PHP however whenever I try and launch the admin console I get this:

I am setting up an existing site for some integration work written in PHP however whenever I try and launch the admin console I get this:

Warning: require_once(DIR_FS_SITE_CONTROL_INCLUDEScontrol_header.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\reflex-nutrition\website_control\index.php on line 21

Can any one point me in the right direction to fix this issue?

Cheers

Justin

*EDIT****

This is my index.php can you tell me where i should put this definition?

    <? 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 "&nbsp;";
                        } ?>
                        <!-------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();
?>

THanks


Possible issues:

  • Included file path is incorrect.
  • Included file name is incorrect.
  • The file you included is deleted or you did not upload it.
  • If DIR_FS_SITE_CONTROL_INCLUDES is a constant then your are not defining it or defining it after require_once()
  • Or you want to do following:

    require_once(DIR_FS_SITE_CONTROL_INCLUDES . '/control_header.php');


It looks like you try to access the constant DIR_FS_SITE_CONTROL_INCLUDES before it is defined.

In your case, the constant seems to be set to the subfolder includes. So you can define it via

define('DIR_FS_SITE_CONTROL_INCLUDES', dirname(__FILE__) . '/includes/');

or

define('DIR_FS_SITE_CONTROL_INCLUDES', './includes/');

or on PHP 5.3

define('DIR_FS_SITE_CONTROL_INCLUDES', __DIR__ . '/includes/');


You need to concatenate the constant and the string:

require_once(DIR_FS_SITE_CONTROL_INCLUDES . 'control_header.php');
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号