REMOTE_ADDR in IIS

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

    #1

    REMOTE_ADDR in IIS

    Hi,

    In IIS 6, windows 2003 with php 4.3.11, the code REMOTE_ADDR
    does not show the IP, but the same page in apache2triad shows the
    IP.


    I tried
    <? $ip = getenv("REMOTE_ ADDR"); print $ip; ?>
    and
    $_SERVER['REMOTE_ADDR']

    regards,

    http://www.DevPlug.com --Connecting Developers
    Posted from: http://www.devplug.com/ftopic57612.htm
  • Janwillem Borleffs

    #2
    Re: REMOTE_ADDR in IIS

    aabrahao wrote:[color=blue]
    > In IIS 6, windows 2003 with php 4.3.11, the code REMOTE_ADDR
    > does not show the IP, but the same page in apache2triad shows the
    > IP.
    >
    >
    > I tried
    > <? $ip = getenv("REMOTE_ ADDR"); print $ip; ?>
    > and
    > $_SERVER['REMOTE_ADDR']
    >[/color]

    Check the output of phpinfo() to see if anything useful is in there.


    JW



    Comment

    • Jerry Stuckle

      #3
      Re: REMOTE_ADDR in IIS

      aabrahao wrote:[color=blue]
      > Hi,
      >
      > In IIS 6, windows 2003 with php 4.3.11, the code REMOTE_ADDR
      > does not show the IP, but the same page in apache2triad shows the
      > IP.
      >
      >
      > I tried
      > <? $ip = getenv("REMOTE_ ADDR"); print $ip; ?>
      > and
      > $_SERVER['REMOTE_ADDR']
      >
      > regards,
      >
      > http://www.DevPlug.com --Connecting Developers
      > Posted from: http://www.devplug.com/ftopic57612.htm[/color]

      The environment variables are set up by the server, and Apache and IIS don't
      necessarily share the same values.

      The suggestion to use phpinfo() is a good one - it will show you just what you
      have in IIS - which will be different from Apache.

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • aabrahao

        #4
        re:REMOTE_ADDR in IIS

        There is the link from the IIS server:



        Thanks,

        http://www.DevPlug.com --Connecting Developers
        Posted from: http://www.devplug.com/ftopic57612.htm

        Comment

        • Andy Hassall

          #5
          Re: REMOTE_ADDR in IIS

          On Mon, 25 Jul 2005 17:07:00 -0000,
          artur.abrahao@t erra.com-dot-br.no-spam.invalid (aabrahao) wrote:
          [color=blue]
          >There is the link from the IIS server:
          >
          >http://www.hij.com.br/helpme/phpinfo.php[/color]

          That page shows REMOTE_ADDR set correctly under the "ISAPI" section, which
          should therefore appear in $_SERVER...

          --
          Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
          <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

          Comment

          • aabrahao

            #6
            re:REMOTE_ADDR in IIS

            Hi,

            Yes, the $_SERVER['REMOTE_ADDR']; is working.
            I made some changes in the windows security at the php folder,
            maybe was coincidence.
            But the $ip = getenv("REMOTE_ ADDR"); print $ip; realy does not
            work, why?
            Why its works in apache2triad and don't in IIS?

            Thanks,

            http://www.DevPlug.com --Connecting Developers
            Posted from: http://www.devplug.com/ftopic57612.htm

            Comment

            • Janwillem Borleffs

              #7
              Re: re:REMOTE_ADDR in IIS

              aabrahao wrote:[color=blue]
              > Why its works in apache2triad and don't in IIS?
              >[/color]

              From: http://phplens.com/phpeverywhere/node/view/32

              "For ISAPI modules, the server varibles are stored in the $_SERVER array.
              For CGI, they are stored as environment variables, available from the $_ENV
              array or getenv( )."


              JW



              Comment

              Working...