Jump to content

Including a File in the Parent Directory


Fmdpa
 Share

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...