SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict DevilBear's Avatar
    Join Date
    Oct 2001
    Location
    Hades
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do includes outside the document root work?

    My understanding is that if a path is in the include_path, then you can include() from that path even if it's above the web server's document root...

    I've added /usr/local/zend/library to the include path, and yet I get:

    Warning: include() [function.include]: Failed opening '1' for inclusion (include_path='.:/usr/local/pear/PEAR:/php/includes:/usr/local/zend/library') in /Library/WebServer/Documents/project/path/file.php on line 4

    Any ideas?

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Failed opening '1' for inclusion
    I don't understand that message.

    Put a test file in that zend/library folder:

    test.inc.php
    PHP Code:
    <?php
    echo "found!! ;
    ?>
    [/php]

    Then in a page in a public folder:
    ...
    include 'test.inc.php' ;
    ...

  3. #3
    SitePoint Addict DevilBear's Avatar
    Join Date
    Oct 2001
    Location
    Hades
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That worked; it all seems to be working now. I think I may have just been up too late.

  4. #4
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Ah, that. Well its usually that or the alcohol, or both.


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
  •