Re: Getting The Document Root
| From: | Jeremy Privett | Date: | Thu, 02 Feb 2006 14:16:31 +0000 |
| Subject: | Re: Getting The Document Root | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-229720@lists.php.net to get a copy of this message | ||
George Pitcher wrote:
Jeremy, I think I lead you down the wrong path with my last reply. have a look at $_ENV['ORIG_PATH_TRANSLATED'] which, on my WinXP Apache2 box gives 'C:\Apache\Apache2\htdocs\testsite\phpinfo.php'. Is that what you are after? GeorgeI think my original message may have been confusing. I'll give a better example: I have a path: /home/jeremy/public_html/test/test.php What I want off of the path is just the "root" of the user's document root (e.g. where he stores all his publically viewable files): /home/jeremy/public_html/ Now, the document root can vary from server to server ... Like /var/www/ or /home/jeremy/www/ or whatever. So, I'd like to know if there was a way to dynamically fetch it, instead of putting together a list of the known document roots (hard-coding supported ones). I hope that makes more sense! -- Jeremy Privett [ http://www.jeremyprivett.com ] Founder - Lead Software Developer - Hosting Systems Administrator Omega Vortex (http://www.omegavortex.com)