470,864 Members | 2,015 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,864 developers. It's quick & easy.

$DOCUMENT_ROOT and mod_userdir

When you publish a website in /home/username/public_html and make it
availabe with the mod_userdir apache module, it can be accessed via
http://server/~username/. In that case though, the $DOCUMENT_ROOT
variable is still e.g. /var/www/html. Is there another variable or a trick
to get /home/username/public_html instead?

Frederik

--
Browse securily and fast with the Mozilla Firefox web browser
http://www.spreadfirefox.com/?q=affi...id=617&t=1
Jul 17 '05 #1
2 2574
*** Frederik Himpe escribió/wrote (Wed, 22 Sep 2004 15:24:18 GMT):
When you publish a website in /home/username/public_html and make it
availabe with the mod_userdir apache module, it can be accessed via
http://server/~username/. In that case though, the $DOCUMENT_ROOT
variable is still e.g. /var/www/html. Is there another variable or a trick
to get /home/username/public_html instead?


Maybe playing around with $_SERVER['PHP_SELF'] and basedir().

--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--
Jul 17 '05 #2
Frederik Himpe <se*@reply.to.invalid> wrote:
When you publish a website in /home/username/public_html and make it
availabe with the mod_userdir apache module, it can be accessed via
http://server/~username/. In that case though, the $DOCUMENT_ROOT
variable is still e.g. /var/www/html. Is there another variable or a trick
to get /home/username/public_html instead?

Frederik


Apache transmits DOCUMENT_ROOT as environmental variable (sp?) to PHP, so
maybe you can override it using SetEnv?

--
Simon Stienen <http://dangerouscat.net> <http://slashlife.de>
»What you do in this world is a matter of no consequence,
The question is, what can you make people believe that you have done.«
-- Sherlock Holmes in "A Study in Scarlet" by Sir Arthur Conan Doyle
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by olafmol | last post: by
2 posts views Thread by Rick | last post: by
1 post views Thread by Matthias Pospiech | last post: by
6 posts views Thread by Tom | last post: by
4 posts views Thread by Chris | last post: by
4 posts views Thread by Ronald Raygun | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.