pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feed$_SERVER['SERVER_ADDR'] ; returns wrong value "::1"
3+ messages / 3 participants
[nested] [flat]
* $_SERVER['SERVER_ADDR'] ; returns wrong value "::1"
@ 2005-06-16 04:58 Bill Hernandez <pgsql@mac-specialist.com>
2005-06-16 12:05 ` Re: $_SERVER['SERVER_ADDR'] ; returns wrong value "::1" Postgres Admin <postgres@productivitymedia.com>
2005-06-16 12:49 ` Re: $_SERVER['SERVER_ADDR'] ; returns wrong value "::1" Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 3+ messages in thread
From: Bill Hernandez @ 2005-06-16 04:58 UTC (permalink / raw)
To: pgsql-admin
On 6/15/05 11:08 PM, "Tom Lane" <tgl@sss.pgh.pa.us> 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 "<pre>" ;
print_r($aArray) ;
echo "</pre>" ;
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: $_SERVER['SERVER_ADDR'] ; returns wrong value "::1"
2005-06-16 04:58 $_SERVER['SERVER_ADDR'] ; returns wrong value "::1" Bill Hernandez <pgsql@mac-specialist.com>
@ 2005-06-16 12:05 ` Postgres Admin <postgres@productivitymedia.com>
1 sibling, 0 replies; 3+ messages in thread
From: Postgres Admin @ 2005-06-16 12:05 UTC (permalink / raw)
To: Bill Hernandez <pgsql@mac-specialist.com>; +Cc: pgsql-admin
::1 is a function of the PHP $_SERVER[''] internal function, not a
PostgreSQL problem. It will display ::1 on any database, you program a
PHP custom function to call the whole IP address. The real question is
that a problem in a production environment? Of note, outside IP
addresses will display fine using $_SERVER[''].
Good Luck,
J
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: $_SERVER['SERVER_ADDR'] ; returns wrong value "::1"
2005-06-16 04:58 $_SERVER['SERVER_ADDR'] ; returns wrong value "::1" Bill Hernandez <pgsql@mac-specialist.com>
@ 2005-06-16 12:49 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2005-06-16 12:49 UTC (permalink / raw)
To: Bill Hernandez <pgsql@mac-specialist.com>; +Cc: pgsql-admin
Bill Hernandez <pgsql@mac-specialist.com> writes:
> SERVER_ADDR ::1
> REMOTE_ADDR ::1
> I have no clue where the "::1" is coming from ?
Looks perfectly fine to me; that's the usual IPv6 notation for "local
loopback connection", AFAIK. If your client code cannot cope with IPv6
addresses, consider disabling IPv6 in your network preferences.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2005-06-16 12:49 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-06-16 04:58 $_SERVER['SERVER_ADDR'] ; returns wrong value "::1" Bill Hernandez <pgsql@mac-specialist.com>
2005-06-16 12:05 ` Postgres Admin <postgres@productivitymedia.com>
2005-06-16 12:49 ` Re: $_SERVER['SERVER_ADDR'] ; returns wrong value "::1" Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox