Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Shared Hosting Support

Notices

Reply
 
Thread Tools
  #1  
Old 01-25-2009, 04:30 PM
Turkey Central Turkey Central is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 6
Default Can't Access Directory Above /public_html/

Hello,
I'm trying to store some files in a folder above the root directory. But when I call the file above the public_html directory, I get an error message saying that the file isn't in the "public_html" directory, even though that's not where the path is going.

The file which contains the reference to the file to be included is in:

home/user/public_html/filesystem/

The php reference to the file is this:

file_get_contents('home/user/private/filetest01.txt');

The file being called is:

/home/user/private/filetest01.txt). So the path is trying to get above the "public_html" but is being stopped. I get this warning message:

Warning: file_get_contents(home/user/private/filetest01.txt) [function.file-get-contents]: failed to open stream: No such file or directory in /home/user/public_html/filesystem/file_get_contents.php on line 10
Reply With Quote
  #2  
Old 01-25-2009, 04:54 PM
regentronique's Avatar
regentronique regentronique is offline
King Croc
 
Join Date: Aug 2007
Location: Quebec,Canada
Posts: 969
Default Re: Can't Access Directory Above /public_html/

Are you sure that your directory is "/home/user/private" and that the file in it is "filetest01.txt"? Watch for the lowercase characters, to be sure...
Reply With Quote
  #3  
Old 01-25-2009, 05:36 PM
regentronique's Avatar
regentronique regentronique is offline
King Croc
 
Join Date: Aug 2007
Location: Quebec,Canada
Posts: 969
Default Re: Can't Access Directory Above /public_html/

We are including few files like "/home/OurAccountName/TheIncludedFile.php" without any problems with many different scripts.

But notice the "/" before the "home", this is quite important to put it there.
Reply With Quote
  #4  
Old 01-25-2009, 05:38 PM
Turkey Central Turkey Central is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 6
Default Re: Can't Access Directory Above /public_html/

Thanks for the help regentroniqe, I'll give that a try! When I was looking at the error message it actually was looking in the correct directory.
Reply With Quote
  #5  
Old 01-25-2009, 05:49 PM
Turkey Central Turkey Central is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 6
Default Re: Can't Access Directory Above /public_html/

Thank you regentronique, that fixed it!
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to access index.html or index.php from a folder outside public_html jonel Shared Hosting Support 1 10-02-2008 07:08 AM
Directory Access and MP3 Suitability Musing Pre-Sales Questions 3 10-17-2007 03:32 PM

All times are GMT -5. The time now is 11:12 PM.