Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2003
    Posts
    352

    another php problem can you help?

    one of my friends is having another php problem. check this out below

    this is the error:

    Warning: Unknown(/usr/local/apache/htdocs/random/random.php): failed to open stream: No such file or directory in /home/user/public_html/sources/display.class.php(217) : eval()'d code on line 97

    Warning: (null)(): Failed opening '/usr/local/apache/htdocs/random/random.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/user/public_html/sources/display.class.php(217) : eval()'d code on line 97



    and the code for this file is
    PHP Code:
        // Define document root:
        //***
        
    define("ROOT"$_SERVER['DOCUMENT_ROOT']."/");

        
    //--------------------------

        //***
        // Start up Sessions :
        //***
        
    session_start();

        
    //---------------------------
        //***
        // Load Required Files(config, fuctions, classes, etc):
        //***
        
    require ROOT."config.php";
        require 
    ROOT."sources/functions.php";
        require 
    ROOT."sources/mysql.class.php";
        require 
    ROOT."sources/Vars.class.php";
        require 
    ROOT."sources/User.class.php";
        require 
    ROOT."sources/display.class.php"
    Do you guys have any idea/ what could be wrong with this code?

  2. #2
    Join Date
    Jun 2003
    Posts
    352
    any ideas?

  3. #3
    Join Date
    Jan 2004
    Location
    Montana
    Posts
    9

    Hmm

    Check the permissions - chmod the php file you're working with to 755.

  4. #4
    I think the problem is that your Document Root is not where your files are as by the look of it you are using Apache's userdir feature (are you accessing it by http://some.site.com/~username/?) so it can't find the files it is trying to include.

    Try chaning define("ROOT", $_SERVER['DOCUMENT_ROOT']."/"); to: define("ROOT", "/home/user/public_html/");

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •