note 39403 deleted from reserved.variables by aidan
| From: | aidan@php.net | Date: | Mon, 13 Sep 2004 07:39:13 +0000 |
| Subject: | note 39403 deleted from reserved.variables by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-76595@lists.php.net to get a copy of this message | ||
Note Submitter: gencheff at gmx dot de
----
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.