tags:

views:

75

answers:

2

I use realpath('../'), it work fine but the result is D:wampwww ( real path is D://wamp/www ). Anybody can tell me how to get realpath by the right way? Thanks you verry much.

+3  A: 

Use:

$_SERVER['DOCUMENT_ROOT'];
MarcoPolo
It work fine. Thanks you :)
leduchuy89vn
Then accept his answer by hitting that check mark. That's what we do here.
ryeguy
Note that this probably won't work in a CLI context -- which may or may not be an issue, depending on your project.
Frank Farmer
A: 

You can put some php file into the root and get $rootPath = dirname(FILE) inside it.

FractalizeR