Help - Search - Members - Calendar
Full Version: $_server['document_root']
Zymic Webmaster Forums > Zymic Free Web Hosting > Zymic Free Web Hosting - General Discussion & Help
MC Cullah
why does $_SERVER['DOCUMENT_ROOT'] just display /www/ and not the actual document root?
fenerli
It is the server document root, not the invididual web site root directory.

I handle this by setting the document root by deriving it from the filename for the bootstrap file inside htdocs/ or whatever the web site root is.

i.e.
CODE
substr($_SERVER['SCRIPT_FILENAME'], 0, strrpos($_SERVER['SCRIPT_FILENAME'], '/'))

Over here, it should return /www/subdomain/.../htdocs/
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.