Computing.Net > Forums > Web Development > Php document_root

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Php document_root

Reply to Message Icon

Name: movitto
Date: April 14, 2004 at 22:50:31 Pacific
OS: xp
CPU/Ram: amd 2600
Comment:

Hey;

I just started learning PHP so this is probably an easy question to you guru's.

Im following SAMS PHP in 24 hrs.
One of the .php files in the examples directory contains the command:

$DOCUMENT_ROOT = $HTTP_SERVER_VARS['DOCUMENT_ROOT'];

Every time I run the PHP file i get the same error:

Notice: Undefined index: DOCUMENT_ROOT in c:\inetpub\wwwroot\junk\processorder.php on line 8

It seemed to me the problem had to do with doc_roots environmental variable in php.ini but when I tried setting this to the directory that my files I need to open were in it keeps giving me the same error.

Please note that the rest of the php in the file works and displays correctly.
I am running IIS on xp pro.

So what do you think is wrong?? Is it a syntax thing or a directory thing?? All input is welcome

Thanks;



Sponsored Link
Ads by Google

Response Number 1
Name: anonproxy
Date: April 15, 2004 at 11:15:13 Pacific
Reply:

First off, you should consider notating $HTTP_SERVER_VARS['DOCUMENT_ROOT'] as $_SERVER['DOCUMENT_ROOT'], which is the way things seem to be heading (since PHP 4.2.x and 5.x). Not a problem, just a suggestion.

Secondly, IIS doesn't seem to give you the option to use this variable. The PHP documentation has a solution to this mentioned in the comment section. There's a similar workaround in this thread. Another solution is listed under the reported PHP bug on this issue (though it's not a bug).


0

Response Number 2
Name: movitto
Date: April 15, 2004 at 14:43:11 Pacific
Reply:

Thanks alot for the help anonproxy.

It is much appreciated.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Php document_root

Cannot write to a text file in PHP www.computing.net/answers/webdevel/cannot-write-to-a-text-file-in-php/1414.html

PHP Relative path from Inc. Page www.computing.net/answers/webdevel/php-relative-path-from-inc-page/1780.html

PHP: Counting files in a directory. www.computing.net/answers/webdevel/php-counting-files-in-a-directory/2341.html