Error Message, Help Needed please!

Discussion in 'PHP' started by adam.jn, Feb 18, 2008.

  1. #1
    Hi there,

    While installing a membership manager script, I get the following error message,

    Warning: main(home/theebook/public_html/msm/config.php) [function.main]: failed to open stream: No such file or directory in /home/theebook/public_html/members/members.php on line 13

    Warning: main(home/theebook/public_html/msm/config.php) [function.main]: failed to open stream: No such file or directory in /home/theebook/public_html/members/members.php on line 13

    Warning: main(home/theebook/public_html/msm/config.php) [function.main]: failed to open stream: No such file or directory in /home/theebook/public_html/members/members.php on line 13

    Fatal error: main() [function.require]: Failed opening required 'home/theebook/public_html/msm/config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/theebook/public_html/members/members.php on line 13


    What does that mean?

    I have got a file called config.php in the msm folder ob my server.
    Here is the script that I am working on.

    <?php

    //prevents caching
    header("Expires: Sat, 01 Jan 2000 00:00:00 GMT");
    header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
    header("Cache-Control: post-check=0, pre-check=0",false);
    session_cache_limiter();
    session_start();

    //this should the the absolute path to the config.php file
    //(ie /home/website/yourdomain/login/config.php or
    //the location in relationship to the page being protected - ie ../login/config.php )
    require('home/theebook/public_html/msm/config.php');

    //this should the the absolute path to the functions.php file - see the instrcutions for config.php above
    require('home/theebook/public_html/msm/functions.php');

    //this is group name or username of the group or person that you wish to allow access to
    // - please be advise that the Administrators Groups has access to all pages.
    if ('home/theebook/public_html/msm/allow_access(Administrators) != "yes")
    {

    //this should the the absolute path to the no_access.html file - see above
    include (home/theebook/public_html/msm/no_access.html');
    exit;

    ?>

    Thanks for any help.
    Adam

    Thanks
     
    adam.jn, Feb 18, 2008 IP
  2. daman371

    daman371 Peon

    Messages:
    121
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The paths to the include files are wrong according to the error messages. If they files are in the same directory as the file including them just put the filename such as config.php.
     
    daman371, Feb 18, 2008 IP
  3. adam.jn

    adam.jn Member

    Messages:
    81
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #3
    They are not in the same directory.
     
    adam.jn, Feb 19, 2008 IP
  4. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #4
    
    require('home/theebook/public_html/msm/config.php');
    
    PHP:
    Try a slash at the beginning of your path. At the moment, it would be trying to find config.php in:

    /home/theebook/public_html/msm/home/theebook/public_html/msm/config.php

    as home/ basically means continue from this directory. If you put a slash at the beginning, like:

    
    require('/home/theebook/public_html/msm/config.php');
    
    PHP:
    (do this for all of them)

    then it will become an absolute path.

    Jay
     
    jayshah, Feb 19, 2008 IP