X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2F3355283D for ; Thu, 16 Jun 2005 01:58:34 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 35014-04 for ; Thu, 16 Jun 2005 04:58:24 +0000 (GMT) Received: from smtpout02-04.prod.mesa1.secureserver.net (smtpout02-04.prod.mesa1.secureserver.net [64.202.165.194]) by svr1.postgresql.org (Postfix) with SMTP id 11D2A528AA for ; Thu, 16 Jun 2005 01:58:22 -0300 (ADT) Received: (qmail 19455 invoked from network); 16 Jun 2005 04:58:22 -0000 Received: from unknown (67.166.229.238) by smtpout02-04.prod.mesa1.secureserver.net (64.202.165.194) with ESMTP; 16 Jun 2005 04:58:22 -0000 User-Agent: Microsoft-Entourage/11.0.0.040405 Date: Wed, 15 Jun 2005 23:58:11 -0500 Subject: $_SERVER['SERVER_ADDR'] ; returns wrong value "::1" From: Bill Hernandez To: Message-ID: In-Reply-To: <10056.1118894915@sss.pgh.pa.us> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200506/107 X-Sequence-Number: 17862 On 6/15/05 11:08 PM, "Tom Lane" wrote: Tom, I've been lurking on the pgsql forum for some time, and today I read a reply you had posted, and thought to myself, "He probably has a good idea what is causing my problem", so here it is, if you don't mind taking alook at it... My server is a G4 running OS X Server, and my current workstation is an iMacG5 running OS X 10.4.1 I do my development on the iMacG5, which is a duplicate of the server contents as far as the directory hierarchy is concerned. Once I have stuff working I move a copy to the server. When running in localhost mode on my G5 using something like http://localhost/demo/show_items.php $server_address = $_SERVER['SERVER_ADDR'] ; returns "::1" function ShowArray($aArray) { echo "
" ;
    print_r($aArray) ;
    echo "
" ; return ; } ShowArray($_SERVER) ; shows : HTTP_USER_AGENT Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/412 (KHTML, like Gecko) Safari/412 SERVER_SOFTWARE Apache/2.0.52 (Unix) DAV/2 PHP/5.0.4 HTTP_HOST localhost SERVER_NAME localhost SERVER_ADDR ::1 REMOTE_ADDR ::1 If I run the same page on my workstation, and access the page from the server via the fully_qualified_domain, the http://fully_qualified_domain/demo/show_items.php ShowArray($_SERVER) ; shows : SERVER_SOFTWARE Apache/1.3.33 (Darwin) DAV/1.0.3 mod_ssl/2.8.22 OpenSSL/0.9.7b LittleDutchMoose/v10.3(Build 2A82) PHP/4.3.10 mod_perl/1.26 HTTP_HOST www.my_domain_name.com SERVER_NAME www.my_domain_name.com SERVER_ADDR 192.168.1.47 REMOTE_ADDR 64.166.143.xxx NetInfo shows : machines -> localhost -> 127.0.0.1 I have no clue where the "::1" is coming from ? I have several routines that depend on the $_SERVER['SERVER_ADDR'] , and the $_SERVER['REMOTE_ADDR'] Any help would be appreciated... Bill Hernandez Plano, Texas