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 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2007
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Including Files Before Root Web Dir?

    Is it possible to include files before the root web dir?

    lets say I have 3 sites in a vps that look like this

    /public_html/web1/ - website1.com
    /public_html/web2/ - website2.com
    /public_html/web2/ - website3.com

    i want to include a config file from

    /var/webfiles (public_html is in same dir)

    or /webfiles (var is in same dir)

    Is there a trick to do this? Do I need to edit the php config?

    Nevermind you can. Just tested it with SSH
    Last edited by groog; 04-13-2012 at 02:38 PM.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts
    Hi groog,

    Yes you can do it, you just include the absolute path to the file..

    PHP Code:
    include("/var/webfiles/config.php"); 
    You just need to make sure that the apache user that is calling the included file has permissions to that location.

    Cheers,


  •  

    Posting Permissions

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