Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem setting root variable

    Hi,

    I am having a problem with a PHP site that I moved to a new hosting account. The problem is with setting the $rootBase variable in the index.php file. Since moving the files I am getting the following error:

    Warning: main(/data/15/1/104/140/1430303/user/1536306/htdocs/_inc/config.php) [function.main]: failed to open stream: No such file or directory in /data/15/1/104/140/1430303/user/1536306/htdocs/website2/index.php on line 7

    The current variable string in my index file looks like this:

    $rootBase = $_SERVER["DOCUMENT_ROOT];

    I think the problem stems from the fact that with my new web host, the files are actually in a sub directory of /htdocs. On the old server this was not the case, but my new shared web host makes you place all web sites in their on directory like /htdocs/website2. It appears that the script is looking for the files in root /htdocs directory.

    My questions is this; Since I am new to PHP coding, I do not know the proper syntax to use to change the $rootBase variable string to were it will look in the proper subdirectory (/htdocs/website2) for the files.

    Can this be done? Or maybe there is a .htaccess change I can implement to make this happen? Any suggestions would be appreciated.

    Thanks

  • #2
    New Coder
    Join Date
    Sep 2007
    Location
    India
    Posts
    72
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Try

    $rootBase = $_SERVER["DOCUMENT_ROOT]."/website2";

    Good luck
    - Developer from India

    Firefox 2.0

  • #3
    New to the CF scene
    Join Date
    Feb 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That worked. Thanks


  •  

    Posting Permissions

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