A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: using leading slash with php on apache2 vhost

  1. #1
    Member
    Join Date
    Apr 2003
    Location
    North East, MD
    Posts
    62

    using leading slash with php on apache2 vhost

    What do I have to do to make
    require_once("/includes/some.inc.php")
    point to my virtual host root instead of the server root?

    My virt. host root is /srv/www/vhosts/scc/

    I have many layers of directories inside of each virtual host that all pull from a central includes folder, and I need a simple way to just use "/includes/blah" from anywhere.

    Thanks
    "I hate when people put quotes in their signatures" -anonymous

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    maybe a
    <Directory /include>
    or a
    php_value include_path
    could help

    Musicman

  3. #3
    Junior Member
    Join Date
    Nov 2004
    Location
    Bristol, England
    Posts
    18
    Indeed musicman.

    To save going into .htaccess, a simple

    ini_set('include_path', './path/');

    Will do it. This function will work on all 4.x versions, whereas the include_path() function (or whatever it is called) will only work from 4.3.x.

    Hope this helps you.

  4. #4
    Member
    Join Date
    Apr 2003
    Location
    North East, MD
    Posts
    62
    I think my uncertainty about what I was doing made it difficult for me to ask the right question.

    I changed the include_path setting in php.ini to point to my includes dir and it is working ok.

    I thought there was a way to get apache to treat each vhost as it's own server and the leading / would only change to the root of the vhost, not all the way to the "real server" root.
    "I hate when people put quotes in their signatures" -anonymous

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center