Failed opening required with file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bhavesh1978
    New Member
    • Mar 2007
    • 32

    Failed opening required with file

    does any1 here know why i got this error message when i try to run my program in php

    Warning: require_once(ht tp://localhost/own work/sql.inc.php) [function.requir e-once]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\wamp\www\own work\config.inc .php on line 30

    Fatal error: require_once() [function.requir e]: Failed opening required 'http://localhost/own work/sql.inc.php' (include_path=' .;C:\php5\pear' ) in C:\wamp\www\own work\config.inc .php on line 30
  • Bhavesh1978
    New Member
    • Mar 2007
    • 32

    #2
    Originally posted by Bhavesh1978
    does any1 here know why i got this error message when i try to run my program in php

    Warning: require_once(ht tp://localhost/own work/sql.inc.php) [function.requir e-once]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\wamp\www\own work\config.inc .php on line 30

    Fatal error: require_once() [function.requir e]: Failed opening required 'http://localhost/own work/sql.inc.php' (include_path=' .;C:\php5\pear' ) in C:\wamp\www\own work\config.inc .php on line 30
    here is my codeing in php.. is there something i missing.. when i run my program which i got an error which stated above.
    Code:
    <?php
    
    if(!defined('CONFIG_INC'))
        define('CONFIG_INC',1);
    
    $cfg_dbsource='localhost';
    $cfg_dbuser='root';
    $cfg_dbpass='';
    $cfg_dbName='bhav';
    $cfg_dbType='mysql';
    
    session_start();
    //Set no caching
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    
    // This cheap little trick was found over at php.net
    if(PHP_VERSION < "4.1.0")
    {
            $_COOKIE = $HTTP_COOKIE_VARS;
            $_GET = $HTTP_GET_VARS;
            $_POST = $HTTP_POST_VARS;
            $_SERVER = $HTTP_SERVER_VARS;
            $_FILES = $HTTP_POST_FILES;
    }
    
    require_once 'include/sql.inc.php';
    ?>

    Comment

    • code green
      Recognized Expert Top Contributor
      • Mar 2007
      • 1726

      #3
      It is because the file does not exist in the location specified by require or include

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Read the Posting Guidelines on choosing a meaningful title for your thread. The one you use does not tell very much on your problem and will NOT encourage members to look into your post. I have changed the thread title.

        moderator

        Comment

        Working...