Jump to content

Including a File in the Parent Directory


Fmdpa

Recommended Posts

Ok, I'm stumped. I have a file in a subdirectory of my public root directory. I need to access a file in the public root directory. Just stating the filename worked on my Windows localhost. But it isn't working on my Unix host. These are things I've tried, none successful:

require '../my_file.php';require dirname(__FILE__) . '/../my_file.php';

Link to comment
Share on other sites

It doesn't look like it's a permissions problem. Yes, I'm getting an error:PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/public_html/connect.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/[ username ]/public_html/inserts/foot.php[/i] on line 139

Link to comment
Share on other sites

Is the file actually at /public_html/connect.php? Is the public_html directory really in the system root?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...