Include with absolute path

I have root directory in my Apache Server named “www”.
“www” has a directory named “x-test”.

“www” has a file named “13-1.php” (temperal link ) .

“x-test” has a file named “13.php” (temperal link ).

13.php has the code below.

include "[COLOR="red"]../[/COLOR]13-1.php"

With the code above 13.php seems successfully displaying the contents of 13-1.php because 13.php includes 13-1.php .
The code above wrote with a relative path from the location of 13.php

I like to write it with a absolute path from the root, i.e. “www”.
So I made the 14.php (temperal link ) in the “x-test” directory with the code below.

include "[COLOR="Red"]/[/COLOR]13-1.php"

But 14.php seems not to work fine.

Absolute path(/) which start from the root “www” doesn’t work in PHP?


include "/www/13-1.php";

include "/www/13-1.php" 
?> seems not to display the contents of 13-1.php.
I think it’s very strange.

What is the value of $_SERVER[‘DOCUMENT_ROOT’] ?

Thank you. I got it(root) now.

You’re welcome.
What was the solution?

include “/RWAPM/www/13-1.php”;

What about if/when the host changes? Would you not be better to use $_SERVER[‘DOCUMENT_ROOT’] as a variable in the include() rather than the absolute path hard-coded?