473,386 Members | 1,793 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,386 software developers and data experts.

no document_root?

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 because i run a template with an include
inside an eval-block that is requested from 2 different locations.

Thanks, Olaf

Jul 17 '05 #1
6 7767
In article <3f**********************@dreader2.news.tiscali.nl >, olafmol
<ol**@expansions.nl> writes
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 because i run a template with an include
inside an eval-block that is requested from 2 different locations.


Try using $_SERVER["DOCUMENT_ROOT"]

Running phpinfo.php might be of use to you.

--
Surfer!
If you really want to send me email then use:
five_cats at uk2 dot net

Jul 17 '05 #2
"olafmol" <ol**@expansions.nl> wrote:
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 because i run a
template with an include inside an eval-block that is requested from 2
different locations.


Hi Olaf,

Try $_SERVER['DOCUMENT_ROOT']

http://uk.php.net/manual/en/language...predefined.php

HTH;
JOn
Jul 17 '05 #3
the document_root var isn't defined at all..... it doesnt' show up in the
phpinfo list....

any suggestions? is this normal on a windows NT4 IIS4 CGI installation?

Olaf

Five Cats <ca*******@127.0.0.1> wrote in message
news:hG**************@nevis-view.demon.co.uk...
In article <3f**********************@dreader2.news.tiscali.nl >, olafmol
<ol**@expansions.nl> writes
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 ido something about it? I need this because i run a template with an includeinside an eval-block that is requested from 2 different locations.


Try using $_SERVER["DOCUMENT_ROOT"]

Running phpinfo.php might be of use to you.

--
Surfer!
If you really want to send me email then use:
five_cats at uk2 dot net

Jul 17 '05 #4
Use Apache for windows instead

Savut

"olafmol" <ol**@expansions.nl> wrote in message
news:3f**********************@dreader2.news.tiscal i.nl...
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 because i run a template with an include inside an eval-block that is requested from 2 different locations.

Thanks, Olaf

Jul 17 '05 #5
olafmol wrote:
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 because i run a template with an include
inside an eval-block that is requested from 2 different locations.

Thanks, Olaf


DOCUMENT_ROOT I believe is specific to Apache, or at least IIS doesn't
set it. Because of this, when working with IIS, I work off the system
path via:
$DOCUMENT_ROOT=dirname(__FILE__);
which is in a file that I place in the document root. I then have that
file included by all other scripts (sometimes with auto_prepend).

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 17 '05 #6
Justin Koivisto wrote:
olafmol wrote:
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 because i run a template with an
include
inside an eval-block that is requested from 2 different locations.

Thanks, Olaf


DOCUMENT_ROOT I believe is specific to Apache, or at least IIS doesn't
set it. Because of this, when working with IIS, I work off the system
path via:
$DOCUMENT_ROOT=dirname(__FILE__);
which is in a file that I place in the document root. I then have that
file included by all other scripts (sometimes with auto_prepend).


Sorry, I should have provided this as well (from my bookmarks):

http://php.weblogs.com/Apache_IIS

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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...
2
by: Frederik Himpe | last post by:
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...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.