no document_root? – PHP

  php

Q(Question):

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

A(Answer):

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

A(Answer):

"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

A(Answer):

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

A(Answer):

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

A(Answer):

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.

A(Answer):

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.

LEAVE A COMMENT