Page 1 of 1

include("../xx/xx.php"); does not work! y?

Posted: Mon Jul 22, 2002 1:18 pm
by Neon
I guess there is something wrong mit my php or Apache configuration...
include("./xx/xx.php"); woks but not at all. If i use include("../xx/xx.php"); i does not work! I dont know what is wrong plz help me! I want ../ to be a link to my root directory as it works with all other providers i know.


Neon

Posted: Mon Jul 22, 2002 3:50 pm
by gnu2php
Does it work if you use the "absolute" path? Such as "/path/xx/xx.php"

By the way, what's the include_path directive set to? Use phpinfo() to find out.

Also, what's the error message you get? Use require() if there isn't one.

Posted: Mon Jul 22, 2002 7:01 pm
by Neon
the include_path is set to the doc_root which is d:\hp4

the message is: Fatal error: Failed opening required '../media/foot.php' (include_path='d:\hp4') in d:\hp4\index.php on line 3

Posted: Mon Jul 22, 2002 9:29 pm
by gnu2php
Does require("d:\\media\\foot.php") or require("d:/media/foot.php") work? If not, the only way to include it might be to place the foot.php file in the hp4 path--or maybe place the entire media folder in hp4.

Posted: Tue Jul 23, 2002 8:45 am
by Neon
the foot.php is in d:\hp4\media\foot.php !

Posted: Tue Jul 23, 2002 9:03 am
by twigletmac
Then does

Code: Select all

require 'media/foot.php';
work?

Mac

Posted: Wed Jul 24, 2002 9:45 pm
by Neon
Yes it works but i need require("../media/foot.php");
I can use
/media/foot.php
./media/foot.php too...

Posted: Thu Jul 25, 2002 1:41 am
by twigletmac
the foot.php is in d:\hp4\media\foot.php
Then why do you need

Code: Select all

require '../media/foot.php';
to access it from a file in hp4? Basically when you do that you're looking for the file d:\media\foot.php, which, as the error message tells you, doesn't exist.

Mac

Posted: Thu Jul 25, 2002 2:06 am
by gnu2php
If, for some reason, you have to use the dots, you might try this:

Code: Select all

require("../hp4/media/foot.php");

Posted: Thu Jul 25, 2002 4:37 am
by twigletmac
:lol: Good point.

Mac