Log in

View Full Version : DOCUMENT_ROOT on Windows/IIS server ?



chrbar
04-01-2008, 10:11 PM
Hi,

I try to install "Download 2.0" PHP Script from Simon Stenhouse
http://www.simonstenhouse.net/index.php?area=projects
But I meet some difficulties!

I think my problem is "DOCUMENT_ROOT", it's not a good value on Windows/IIS server.
I have to set some informations in this script (see below), I've tried many different values but I'm not able to run this script :confused:

Could you help me :)

Chris

// Root path of your site
$root = $_SERVER['DOCUMENT_ROOT'] . '/';

// Path to downloadable files (will not be revealed to users so they will never know your files real address)
$hidden = 'hidden/';

// Path to data files
// NOTE: This directory must have been CHMOD'd to 777
$data = 'data/';

// Path to and name of your leech warning page
$leech = 'leech.php';

// Path to and name of your hack warning page
$hack = 'hack.php';

// Allow null referer's to download files (true/false). If true, and the referer value is null, the user will still be allowed to download. If false, it will be regarded as a leech attempt. Default is false.
$allow_null_referer = false;

// Limits the download speed (in KB's per second). Default is 24 KB's per second.
$speed = 24;

thetestingsite
04-01-2008, 10:37 PM
If you run a phpinfo(), what value is given for DOCUMENT_ROOT? If it doesn't display anything (which is odd), you will have to "hard-code" this line to point to your web_root.



$root = $_SERVER['DOCUMENT_ROOT'] . '/';


Change to something like so:



$root = 'C:/Inetpub/sites/mysite.com/'; //whatever you webroot is


Hope this helps.

chrbar
04-02-2008, 01:09 PM
Excellent it's done... thanks a lot for your help!