Click to See Complete Forum and Search --> : Getting File or directory not found error


amdRocks
12-14-2003, 12:52 PM
Hi Gurus,
Here is my little problem.
Am running Apache2 and php4+ on win2k machine
in my apache root folder
htdocs
I have a folder that contains some php files say folder1.
then in this folder I have a folder called admin
and at the same level I have few more folders one of which is php
htdocs
----folder1
--------admin/session.php
--------cart/Cart.php (class file)

----php
--------/test1.php
--------/sub_folder
--------------------/deep test

now if you can make sense of my drawing above
I can include "../cart/Cart.php" class in the php folder in test1.php using
include "../admin/session.php
and in session I include
include "Cart.php" class
everything works fine and dandy...however as soon as I use the deep_test.php file my include statment looks like this
include "../../admin/session.php"

I get an error that it can not
Warning: main(../cart/KSCart.php): failed to open stream: No such file or directory

I'd appreciate if some one could help me to sort it out...thanks

pyro
12-14-2003, 01:00 PM
If you use root paths for you includes, all should be well:

include $_SERVER['DOCUMENT_ROOT']."/admin/session.php";

And likewise for other includes...

amdRocks
12-14-2003, 01:17 PM
thanks, seems like it was it..:-)

pyro
12-14-2003, 01:36 PM
You are welcome... :)