Bug #18379: Can't get IP when using SAPI

From: Date: Tue, 16 Jul 2002 21:24:59 +0000
Subject: Bug #18379: Can't get IP when using SAPI
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-14346@lists.php.net to get a copy of this message
From: picklezz@hotmail.com Operating system: Windows XP Pro PHP version: 4.2.1 PHP Bug Type: Apache2 related Bug description: Can't get IP when using SAPI When I install PHP 4.2.1 as a SAPI module to Apache 2.0.39 I haven't had any problems with any of my scripts until I was going to log the IP of my visitors. So I used the fallowing 'script' to get the IP's... <? echo 'REMOTE_ADDR:' . getenv(REMOTE_ADDR); echo 'HTTP_X_FORWARDED_FOR:' . $_ENV['HTTP_X_FORWARDED_FOR']; ?> It won't return anything at all just a empty string... So I tried to install PHP with the CGI support using: #============================================= ScriptAlias /php/ "c:/php/" AddType application/x-httpd-php .php Action application/x-httpd-php "/php/php.exe" #============================================= instead of (Conf. for SAPI): #============================================= LoadModule php4_module c:/php/sapi/php4apache2.dll AddType application/x-httpd-php .php #============================================= Now when I use the same 'script' as above I get both the REMOTE_ADDR and the HTTP_X_FORWARDED_FOR correct... -- Edit bug report at http://bugs.php.net/?id=18379&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=18379&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=18379&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=18379&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=18379&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=18379&r=support Expected behavior: http://bugs.php.net/fix.php?id=18379&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=18379&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=18379&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=18379&r=globals

« previous php.bugs (#14346) next »