SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Aug 2003
    Location
    canada
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question My php includes files are not being found.

    I am getting the following error on my pages with php includes defined on them:

    Failed opening '/php_includes/dblib.inc' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/roskopp/dev/tri-site/php_includes/global.inc on line 2.

    Now to get to this stage what I was trying to accomplish was absolute pathing on my site so I set up 3 Alias's on my apache server:

    /image /var/www/html/roskopp/dev/tri-site/dev/image"
    /css /var/www/html/roskopp/dev/tri-site/dev/css"
    /php_includes /var/www/html/roskopp/dev/tri-site/dev/php_includes"

    Everything is fine excpet for the /php_includes. I have even tried moving global.inc into image and css but it still can't find the buggar. So I am wondering what is the deal with absolute pathing and php includes? Do I need to edit something in the php.ini file? Whats the deal?

    I am calling the include like so in my file:

    include "/php_includes/global.inc";

    Thanks in advance,
    TriG33k
    Last edited by TriG33k; Sep 11, 2003 at 13:36.

  2. #2
    Put your best practices away. The New Guy's Avatar
    Join Date
    Sep 2002
    Location
    Canada
    Posts
    2,087
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    try this.

    include "../php_includes/global.inc";
    "A nerd who gets contacts
    and a trendy hair cut is still a nerd"

    - Stephen Colbert on Apple Users

  3. #3
    La la la la la bronze trophy lieut_data's Avatar
    Join Date
    Jun 2003
    Location
    Waterloo, ON
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TriG33k
    I am calling the include like so in my file:

    include "/php_includes/global.inc";
    Just as an FYI

    '/folder/' references the root folder in the current context (usually /var/www/html/folder)

    './folder/' references a folder in the current directory (also just 'folder/')

    and, as the New Guy pointed out:

    '../folder/' references a folder on the same level as the current folder (i.e. the parent folder's child, the current directory's brother [or sister])
    My name is Steve, and I'm a super-villian.

  4. #4
    SitePoint Member
    Join Date
    Aug 2003
    Location
    canada
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My apologies for not being more specific, but I am looking to move away from relative pathing over to absolute pathing.

  5. #5
    La la la la la bronze trophy lieut_data's Avatar
    Join Date
    Jun 2003
    Location
    Waterloo, ON
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TriG33k
    My apologies for not being more specific, but I am looking to move away from relative pathing over to absolute pathing.
    Ok:
    PHP Code:
    include "/dev/php_includes/global.inc"
    My name is Steve, and I'm a super-villian.

  6. #6
    SitePoint Member
    Join Date
    Aug 2003
    Location
    canada
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the suggestions but its still a no go.

    I've removed the alias in my Apache http.conf file and now have turned my attention towards the php.ini file. In the past the include_path was commented out, so I put it back in and gave it the following value:

    include_path = ".:/var/www/html/roskopp/dev/tri-site"

    So really, all I would need to do is put the following include reference at the top of my php page:

    include "/php_includes/global.inc";

    (path is /var/www/html/roskopp/dev/tri-site/php_includes/)

    However, it still says it cannot find...lol...its prolly something simple I am overlooking


Bookmarks

Posting Permissions

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