Page 1 of 1

DOCUMENT_ROOT not available for IIS

Posted: Sat 20. Dec 2003, 19:15
by KM
Hello,

the usage of DOCUMENT_ROOT ist not possible for IIS, thus all scripts using it will fail.

Pls see also
http://bugs.php.net/bug.php?id=11759

Do you have any idea to get it run under Win2K with IIS 5.0?

Regards,
KM

Posted: Tue 23. Dec 2003, 20:22
by pSouper
you could try setting document root in the include\inc_libdefault.inc.php to the actuall address on the hardisk...
currently...

Code: Select all

define ("PHPWCMS_ROOT", preg_replace('/\/$/', '', $_SERVER['DOCUMENT_ROOT']).(($phpwcms["root"]) ? "/".$phpwcms["root"] : "") );
change to..

Code: Select all

define ("PHPWCMS_ROOT", "DriveLetter:\Directory/SubDirectory/WWWRootDirectory/".(($phpwcms["root"]) ? "/".$phpwcms["root"] : "") );
the only other instance of DOCUMENT_ROOT is in /img/random_image.php
hope it helps.

Posted: Sun 28. Dec 2003, 13:44
by Florian
Well, pSoupers solution seem's to be a good one.

I run my dev phpwcms under W2003 Server Enterprise Edition (MSDN Eval.) and IIS 6.0. I have absolutly no problems with it. Maybe your php.ini declarations are worng at any line, or (more possible) the directories permissions are not set in the right way on your system.

Cheers,
Florian

Posted: Fri 30. Jan 2004, 00:20
by Oliver Georgi
Here is a simpler solution:

If you think or know that there is no $_SERVER['DOCUMENT_ROOT'] var set for your PHP install (often seen on IIS) then add following line to your conf.inc.php

$_SERVER['DOCUMENT_ROOT'] = 'path_to_my_doc_root';

Regards
Oliver

Posted: Tue 30. Mar 2004, 13:10
by peteinman
Well that worked beautifully. :D

Thanks everyone for your help.

Now to find out how to create menus, pages and categories, and basically use the product.

Thanks again.

Pete

Posted: Fri 2. Apr 2004, 19:50
by antipodean
Hello all. Just wanted to add a post to this thread for info only. This seems to be a problem that is not specific to IIS and Windows. I could not edit articles until I had applied this same solution (Oliver's post above) and I am running apache server on Mac OS X (10.2.8).

See this thread

http://www.phpwcms.de/forum/viewtopic.p ... sc&start=0

Thanks Oliver for a simple solution.