Skip to content
Replace $_SERVER['REMOTE_ADDR'] according to X-Real-IP or like.
Latest commit 5731d3f Nov 8, 2011 @yohgaki update README
Failed to load latest commit information.
CREDITS ver 0.1 Nov 7, 2011
LICENSE ver 0.1 Nov 7, 2011
README update README Nov 8, 2011
config.m4
php_realip.h add author Nov 8, 2011
realip.c ver 0.1 Nov 7, 2011
realip.ini ver 0.1 Nov 7, 2011

README

RealIP module is made for PHP servers behind reverse proxy.

    ***** SECURITY WARNING *****
    NEVER ENABLE THIS MODULE WITHOUT REVERSE PROXY.
    OTHERWISE YOU MAY HAVE SECURITY PROBLEM.


This module sets $_SERVER['REMOTE_ADDR'] according to 
"realip.realip_header" php.ini. This module is disabled
by default for security reason.

=== How to install ===
1. Clone or download files.
2. run "phpize" command in the realip module directory.
   (phpize command is blong to php-devel package for most Linux)
3. run "./configure --with-realip"
4. run "make && make install"
5. copy realip.ini to ini scan directory. e.g /etc/php.d/
6. edit realip.ini, then restart your web server.

=== php.ini EXAMPLES ===
;X-Real-IP is the real client IP. (default)
realip.enable=1
realip.realip_header="HTTP_X_REAL_IP"

;X-Forwarded-For is the real client IP.
realip.enable=1
realip.realip_header="HTTP_X_FORWARDED_FOR"

=== FUNCTION ===
mix realip(void)
This function returns IP address of true client. Return FALSE
when realip is disalbed. Return NULL if there is no remote address.
i.e. CLI


Auther: Yasuo Ohgaki <yohgaki@ohgaki.net> / <yohgaki@php.net>

Something went wrong with that request. Please try again.