Results 1 to 15 of 15

Thread: Root Path

  1. #1

    Question Root Path

    Hi all!
    First time posting on this forum so pls correct me if I go wrong anywhere.

    My problem is that I am using php and whenever I use the ../ root path nothing works or I get errors.
    I need this to define the root path of my forum which is located /forum/
    but when I use ../forum/ i get errors, this is not the first time this has happend.
    Do I need to update my php or something because that root path works on my friend's sites.
    I am running on php 3.

    Andy Wilson

  2. #2
    Join Date
    Jan 2003
    Posts
    1,715
    My #1 pet peeve is vague error reports. Why should I waste time to discover information you already know? Not only do you need to wait that much longer to resolve your issue, but it means the next person in line waits longer before I can address their issue.

    You get errors? What do you errors say? The forums work perfectly with some other root path, or you can't get them running at all?

    PHP 3.x is ANCIENT by web standards. Unless you have some script that flat-out doesn't work under 4.x, you will be better off upgrading.
    Game Servers are the next hot market!
    Slim margins, heavy support, fickle customers, and moronic suppliers!
    Start your own today!

  3. #3
    you need to update to php 4

  4. #4
    OK, it kinda turns out that I have php version 4.3.6 isn't this a fairly recent version? If so why isn't the ../ root path working at all?

  5. #5
    Join Date
    Jun 2004
    Location
    Chicago, IL
    Posts
    15
    Call phpinfo() and see if the _SERVER["DOCUMENT_ROOT"] gives you correct value

  6. #6

    Post

    OK, tried that for the doc_root i get no value on both local and master value.

    Please help,
    Andy Wilson
    Last edited by Andy_Wilson; 06-02-2004 at 06:02 PM.

  7. #7
    Try using absolute paths. /home/username/www/forum/ for example.
    Dan Grossman - dan @ awio.com
    My Blog | Affiliate Program for Web Hosts

  8. #8
    The absolute path doesn't work because it thinks that the absolute path is a directory (flashpointfx-studios.com/portal.php - the page I am using)
    The pictures don't show and the links don't work.

    Andy Wilson

  9. #9
    Bump, please I need help fast!
    This root path thing is really holding my site back.

  10. #10
    Perhaps your web host, or the author of the script you're trying to get working, can help you better.
    Dan Grossman - dan @ awio.com
    My Blog | Affiliate Program for Web Hosts

  11. #11
    Join Date
    Apr 2004
    Location
    Texas
    Posts
    163
    What forums are you using?
    Unfortunatly hard to help with your problem without knowing the script or at least see the code please post those and may be able to help you out
    DSL WebHosting Solutions
    Fast Affordable WebHosting Solutions
    24/7/365 Support

  12. #12
    Join Date
    Dec 2003
    Location
    Pakistan
    Posts
    344
    I can help you with ASP code. there are so many PHP programmers, hope somebody can translate it
    [vb]
    Dim sPath, pos
    sPath = Server.MapPath("/111")
    sPath = left(sPath, len(sPath) - 4)
    pos = InStrRev(sPath, "\", -1, 1)
    if pos > 0 then
    sPath = left(sPath , pos -1)
    end if
    [/vb]
    Muhammad Waseem
    Inspedium Corporation (Pvt) Ltd.
    InsPanel - Hosting Control Panel for Windows 2000/2003

  13. #13
    OK, I'm using phpbb forums and I've included part of the code in the portal I'm trying to use.

    PHP Code:
    <?php
    #######################################################################
    ##                                                                   ##
    ## phpBB Fetch All - displays phpBB on any page                      ##
    ## ----------------------------------------------------------------- ##
    ## A portal example file.                                            ##
    ##                                                                   ##
    #######################################################################
    ##                                                                   ##
    ## Authors: Volker 'Ca5ey' Rattel <ca5ey@clanunity.net>              ##
    ##          [url]http://clanunity.net/portal.php[/url]                          ##
    ##                                                                   ##
    ## This file is free software; you can redistribute it and/or modify ##
    ## it under the terms of the GNU General Public License as published ##
    ## by the Free Software Foundation; either version 2, or (at your    ##
    ## option) any later version.                                        ##
    ##                                                                   ##
    ## This file is distributed in the hope that it will be useful,      ##
    ## but WITHOUT ANY WARRANTY; without even the implied warranty of    ##
    ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the      ##
    ## GNU General Public License for more details.                      ##
    ##                                                                   ##
    #######################################################################

    //
    // This path points to the directory where phpBB is installed. Do
    // not enter an URL here. The path must end with a trailing
    // slash.
    //
    // Examples:
    // forum in /aaa/bbb/ccc/ and script in /aaa/bbb/ccc/
    // --> $phpbb_root_path = './';
    // forum in /aaa/bbb/ccc/ and script in /aaa/bbb/
    // --> $phpbb_root_path = './ccc/';
    // forum in /aaa/bbb/ccc/ and script in /aaa/bbb/ddd/
    // --> $phpbb_root_path = '../ccc/';
    //

    $phpbb_root_path '../forum/';

    //
    // this setting is for the clanunity site - ignore it
    //
    // $phpbb_root_path = '../forum/';

    define ('IN_PHPBB'true);

    if (!
    file_exists($phpbb_root_path 'extension.inc'))
    {
        die (
    '<tt><b>phpBB Fetch All:</b>
              $phpbb_root_path is wrong and does not point to your forum.</tt>'
    );
    }

    //
    // phpBB related files
    //

    include_once ($phpbb_root_path 'extension.inc');
    include_once (
    $phpbb_root_path 'common.' $phpEx);
    include_once (
    $phpbb_root_path 'includes/bbcode.' $phpEx);

    //
    // Fetch All related files - we do need all these because the portal is a
    // huge example
    //

    include_once ($phpbb_root_path 'mods/phpbb_fetch_all/common.' $phpEx);
    include_once (
    $phpbb_root_path 'mods/phpbb_fetch_all/stats.' $phpEx);
    include_once (
    $phpbb_root_path 'mods/phpbb_fetch_all/users.' $phpEx);
    include_once (
    $phpbb_root_path 'mods/phpbb_fetch_all/polls.' $phpEx);
    include_once (
    $phpbb_root_path 'mods/phpbb_fetch_all/posts.' $phpEx);
    include_once (
    $phpbb_root_path 'mods/phpbb_fetch_all/forums.' $phpEx);

    //
    // start session management
    //
    It's the
    PHP Code:
    $phpbb_root_path '../forum/'
    bit that doesn't work because the ../ root path doesn't work.

    Andy Wilson

  14. #14
    It should be a full path. Try /home/username/public_html/forum or /home/username/www/forum or just ask your host.... they're the ones that know how your server is configured.
    Dan Grossman - dan @ awio.com
    My Blog | Affiliate Program for Web Hosts

  15. #15
    OK this may sound very wierd but true:
    I figured there was no way to set the ../ root path so I decided to rename the .php extension to .html I tried it in the browser and it came out bla bla (please dont ask what was goin through my head, I'm a demented freak ).
    I renamed the extension again back to .php tried it in the browser and...... WALA!!!
    It worked! I dont know how but it did.

    Thanks you guys anyway for your support.
    Andy Wilson

Posting Permissions

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