THe company I work for is moving the host for the site I've done for them. It uses $DOCUMENT_ROOT. The old host was a unix/apache based system. The new host is windows/IIS.

The problem $DOCUMENT_ROOT does not exist. I can not find a referance that tells me what needs to be configured to make this work.

globals are on in the php.ini
And this needs to work as is did under apache where the value is unique to each subdomain.

Thanks in advance.

Alan

    That returns a null

    If I look at the output of the phpinfo() function the string "DOCUMENT_ROOT" does not exist.

      #1 document root returns the server side path not the http path so it wouild be c:/inetpub/somefolder

      #2 I don't want to hard code the path. The software runs on 5 subdomains right now and more as my client adds clients. So I really need a proper dynamic referance.

        11 days later

        You are running PHP in CGI mode when using it with IIS, so unfortunately, you cannot use $DOCUMENT_ROOT. The only two options I can think of is:

        Create an include file that contains:
        define(DOCUMENT_ROOT, "c:\inetpub\wwwroot") and then include that in all PHP files - you can then call $DOCUMENT_ROOT variable.

        Trash IIS and use Apache for Windows (much easier!)

        HTH

        Jonathen

          Write a Reply...