getting scripts to run on PHP 5 with Windows NT

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DH

    getting scripts to run on PHP 5 with Windows NT

    I normally develop PHP projects on a Windows PC (WAMP) and then upload
    the stuff to Linux/Apache/MySQL4.x/PHP4.x

    Now I have to install a content management system on PHP 5 where the
    server is Windows NT CS-PORTAL 5.2. The client owns the server, and
    refuses to open a commercial web hosting account (as do all my other
    clients).

    phpinfo() doesn't return $_SERVER['DOCUMENT_ROOT'] which has me
    wondering how many changes I'm going to have to make in my CMS in order
    to get it to run on an NT server?

    TIA. My news client crashed while posting this the first time. Please
    excuse any resulting double-post.

  • nc@iname.com

    #2
    Re: getting scripts to run on PHP 5 with Windows NT

    DH wrote:[color=blue]
    >
    > I have to install a content management system on PHP 5 where
    > the server is Windows NT CS-PORTAL 5.2. The client owns the
    > server, and refuses to open a commercial web hosting account
    > (as do all my other clients).
    >
    > phpinfo() doesn't return $_SERVER['DOCUMENT_ROOT'] which has
    > me wondering how many changes I'm going to have to make in my
    > CMS in order to get it to run on an NT server?[/color]

    Exactly two.

    1. Run grep (or another search and replacement utility) and
    change all occurences of $_SERVER['DOCUMENT_ROOT'] in your
    code to a configuration variable, say, $docroot.

    2. In your configuration file (you probably have one),
    define the $docroot:

    $docroot = $_SERVER['DOCUMENT_ROOT'];

    This will be your default definition you will use for all
    your clients. For the client you are having trouble with,
    change this line manually to something like:

    $docroot = 'C:/Inetpub/www';

    Alternatively, check the output of phpinfo(); there may
    be something usable in the $_ENV variable...

    The lesson: don't expect environment variables to be there.
    You don't know where your software may end up tomorrow. Set
    defaults using environment variables, but be open to changing
    settings during implementation. ..

    Cheers,
    NC

    Comment

    • CJ Llewellyn

      #3
      Re: getting scripts to run on PHP 5 with Windows NT

      "DH" <doug861@comcas t.net> wrote in message
      news:sc6dnQSldd DNV3_cRVn-hg@comcast.com. ..[color=blue]
      > I normally develop PHP projects on a Windows PC (WAMP) and then upload
      > the stuff to Linux/Apache/MySQL4.x/PHP4.x
      >
      > Now I have to install a content management system on PHP 5 where the
      > server is Windows NT CS-PORTAL 5.2. The client owns the server, and
      > refuses to open a commercial web hosting account (as do all my other
      > clients).
      >
      > phpinfo() doesn't return $_SERVER['DOCUMENT_ROOT'] which has me
      > wondering how many changes I'm going to have to make in my CMS in order
      > to get it to run on an NT server?[/color]

      Dunno, do you habitually use absolute paths in your programming?




      Comment

      • Chung Leong

        #4
        Re: getting scripts to run on PHP 5 with Windows NT

        "DH" <doug861@comcas t.net> wrote in message
        news:sc6dnQSldd DNV3_cRVn-hg@comcast.com. ..[color=blue]
        > I normally develop PHP projects on a Windows PC (WAMP) and then upload
        > the stuff to Linux/Apache/MySQL4.x/PHP4.x
        >
        > Now I have to install a content management system on PHP 5 where the
        > server is Windows NT CS-PORTAL 5.2. The client owns the server, and
        > refuses to open a commercial web hosting account (as do all my other
        > clients).
        >
        > phpinfo() doesn't return $_SERVER['DOCUMENT_ROOT'] which has me
        > wondering how many changes I'm going to have to make in my CMS in order
        > to get it to run on an NT server?
        >
        > TIA. My news client crashed while posting this the first time. Please
        > excuse any resulting double-post.[/color]

        Is your client willing to install Apache 2? From my own experience PHP is
        always somewhat flaky on IIS.

        But to answer your question, it wouldn't be that hard to get it to work on
        IIS. The following are variables provided by the ISAPI module:

        "AUTH_PASSWORD" ,
        "AUTH_TYPE" ,
        "AUTH_USER" ,
        "CONTENT_LENGTH ",
        "CONTENT_TY PE",
        "PATH_TRANSLATE D",
        "QUERY_STRI NG",
        "REMOTE_ADD R",
        "REMOTE_HOS T",
        "REMOTE_USE R",
        "REQUEST_METHOD ",
        "SERVER_NAM E",
        "SERVER_POR T",
        "SERVER_PROTOCO L",
        "SERVER_SOFTWAR E",
        "APPL_MD_PA TH",
        "APPL_PHYSICAL_ PATH",
        "INSTANCE_I D",
        "INSTANCE_META_ PATH",
        "LOGON_USER ",
        "REQUEST_UR I",
        "URL",

        Not on the list are DOCUMENT_ROOT, SCRIPT_NAME, and SCRIPT_FILENAME .


        Comment

        Working...