#42094 [Fbk->Opn]: getenv("REMOTE_ADDR") returns no IP address

From: Date: Thu, 26 Jul 2007 00:48:12 +0000
Subject: #42094 [Fbk->Opn]: getenv("REMOTE_ADDR") returns no IP address
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115451@lists.php.net to get a copy of this message
ID: 42094 User updated by: fushimi at rep dot fielding dot nec dot co dot jp Reported By: fushimi at rep dot fielding dot nec dot co dot jp -Status: Feedback +Status: Open -Bug Type: IIS related +Bug Type: Apache2 related Operating System: Windows 2000 PHP Version: 5.2.3 New Comment: Thank you, to reply me so quickly. Yes, $_SERVER['REMOTE_ADDR'] return the right IP address. One more thing that I forgot to mention, my Http server is Apache version 2.2.4. To help you, below is the results of PHP variable using phpinfo(): PHP5.2.3 and Apache2.2.4 ======================== _SERVER["SERVER_ADDR"] 192.168.1.3 _SERVER["SERVER_PORT"] 80 _SERVER["REMOTE_ADDR"] 0.0.0.0 _SERVER["REMOTE_PORT"] 0 PHP5.1.2 and Apache2.0.59 ========================= _SERVER["SERVER_ADDR"] 192.168.1.2 _SERVER["SERVER_PORT"] 80 _SERVER["REMOTE_ADDR"] 192.168.1.1 _SERVER["REMOTE_PORT"] 2476 Previous Comments: ------------------------------------------------------------------------ [2007-07-25 11:58:27] jani@php.net Does it show up in $_SERVER['REMOTE_ADDR'] ?? ------------------------------------------------------------------------ [2007-07-25 07:53:25] fushimi at rep dot fielding dot nec dot co dot jp Description: ------------ I am evaluating the newest PHP 5.2.3, in relation with my current PHP 5.1.2. So, when I tried to get the remote IP using getenv(“REMOTE_ADDR”), I obtained the following results: PHP 5.2.3 => return 0.0.0.0 PHP 5.1.2 => return 192.168.1.1 PHP in ISAPI mode. Reproduce code: --------------- $ip = getenv("REMOTE_ADDR"); echo "IP Address ....: ".$ip; Expected result: ---------------- IP Address ....: 192.168.1.1 Actual result: -------------- IP Address ....: 0.0.0.0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42094&edit=1

« previous php.bugs (#115451) next »