473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

$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 2645
*** 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: olafmol | last post by:
Hello, on my windows NT4 server with IIS4 and PHP Version 4.3.1 i don't have any "DOCUMENT_ROOT" environment var. Is there any reason i dont get this? Can i do something about it? I need this...
2
by: Rick | last post by:
I am using dynamic vhost on my apache development server (conf at end of msg). I am using $_SERVER in the sites I am working on, which, as you may have guessed isnt giving me the full path of...
1
by: Matthias Pospiech | last post by:
I need to access $DOCUMENT_ROOT together with the option register_globals = Off How can I acces the content of $DOCUMENT_ROOT with another variable since it is empty with register_globals = Off ...
6
by: Tom | last post by:
I'm trying to dynamically adjust the path for one of my scripts using this: $script_path = str_replace( $_SERVER, "", dirname(realpath(__FILE__)) ) . DIRECTORY_SEPARATOR; The problem: the...
4
by: Chris | last post by:
I'm working on a large intranet group site with a lot of pages, file types, folders, subfolders, etc. I am using the include ('../includes/file.php') , but I would like to have a single snippet...
4
by: monomaniac21 | last post by:
Why does this find the file: <img src="<?=$_SERVER?>/images/viessmann_header_logo.gif"> But this does not? $right_content = $_SERVER."includes/content/content.php";
12
by: comp.lang.php | last post by:
Env: Windows XP, Apache 1.33, PHP 5.2.0 <? echo is_dir($_SERVER) . " for dir = " . $_SERVER); ?>
6
by: sakthipro | last post by:
Hi, I am using the Linux Server and server variable $_SERVER to get the root folder to open a text file located in the folder for ex. fopen($_SERVER."/folder/file.txt","r"); .........
4
by: Ronald Raygun | last post by:
I have just discovered that the value reported for $_SERVER by phpinfo is different from the value I obtain when I run the following: <?php echo $_SERVER ?> My natural assumption is to assume...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.