note 39403 added to reserved.variables
| From: | gencheff at gmx dot de | Date: | Tue, 27 Jan 2004 16:13:07 +0000 |
| Subject: | note 39403 added to reserved.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-64263@lists.php.net to get a copy of this message | ||
Adding DOCUMENT_ROOT to IIS
I don't think, that I'm the only fool, who ever had to take an existing PHP application
out of a fully working Apache environment and make it run under a silly IIS, only to find, that this
product relies on the server variable $DOCUMENT_ROOT.
As the IIS does not deliver this server variable, the app won't run. If you've got
administrative privileges on the IIS machine, you're in luck, coz I found a simple workaround.
PHP lets you specify a auto-prepend (and append-) file in the .ini file:
"auto_prepend_file".
You can create a, say, document_root.php and place the following code into it:
<? global $DOCUMENT_ROOT; $DOCUMENT_ROOT="<path to the root of your webserver>";
?>
Now you edit your php.ini and set auto_prepend_file to point to your document_root.php.
Bob's your uncle.
----
Manual Page -- http://www.php.net/manual/en/reserved.variables.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39403
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39403&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39403&report=yes
Search -- http://master.php.net/manage/user-notes.php