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 7 of 7
  1. #1
    New Coder
    Join Date
    Apr 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Opening files outside the webserver folder

    The disk space of the drive where my webserver folder is located is low.
    So i decided to put the other files in a separate drive outside from the webserver folder.

    I made my page in windows desktop. and i used this commands to open the file. and it works.

    $filename = "D:/biography.html";
    include($filename);

    when i transfer my code into the server which is mac it won't work.
    i already change directory in mac.

    I hope someone would help me with this?
    Thanks...

  • #2
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    Did you verify that the webserver process (Apache for instance) has permissions to read outside of its DocumentRoot and that specific directory you are trying to access?

    when i transfer my code into the server which is mac it won't work.
    It helps to give some information about your environment and exactly what the error message is. It is easier that way for someone to help you.

    For instance, it would help to know what webserver you are running.

  • #3
    New Coder
    Join Date
    Apr 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    All the php settings is still set to default. I look in the DocumentRoot setting and this is its value _SERVER["DOCUMENT_ROOT"] = /Library/WebServer/Documents.

    How do i set the webserver to read outside the Document Root?

    These are the error messages...

    Warning: main(Volumes/Movies & More/opac/44352/) [function.main]: failed to open stream: No such file or directory in /Library/WebServer/Documents/lib/OPAC/opac.php on line 14

    Warning: main() [function.include]: Failed opening 'Volumes/Movies & More/opac/44352/' for inclusion (include_path='.:') in /Library/WebServer/Documents/lib/OPAC/opac.php on line 14

  • #4
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    Are you specifying an actual file to include?

    Warning: main() [function.include]: Failed opening 'Volumes/Movies & More/opac/44352/' for inclusion (include_path='.:') in /Library/WebServer/Documents/lib/OPAC/opac.php on line 14
    This makes it sound like it is trying to include the directory 'Volumes/Movies & More/opac/44352/', which to my knowledge is not possible.

  • #5
    New Coder
    Join Date
    Apr 2006
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Actually i'm including a directory because i assume that the index file or home file will be shown when i do that.

    Does it work like that?

  • #6
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    no, it doesn't.

    ALso, should you not have a / at the beginning of the filepath as well?
    My thoughts on some things: http://codemeetsmusic.com
    And my scrapbook of cool things: http://gjones.tumblr.com

  • #7
    New Coder
    Join Date
    Jan 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    suerly you need the other drive to be accessable from the web for clients to view the files of the other drive??
    woooooo!

    visit my website:
    click here!


  •  

    Posting Permissions

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