Support » Plugin: GeoTargeting Lite - WordPress Geolocation » PHP Warning: inet_pton() error

  • hi,

    i get this error:
    [22-Oct-2016 10:58:28 UTC] PHP Warning: inet_pton(): Unrecognized address 2a02:8084:0902:df80:986c:48f9:c490:c7c8 in /home/gerardc6/public_html/wp-content/plugins/geotargeting/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php on line 121

    i have host on siteground and i use php7.0.12 (siteground support only ipv4)

    can this be solved?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Damian

    (@timersys)

    Hi Marius,
    Do you know PHP ? Try creating a test page and print the following:

    echo isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : 'no-ip';
    // cloudflare
    echo isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ? $_SERVER['HTTP_CF_CONNECTING_IP'] : 'no-ip';
    // reblaze
    echo isset( $_SERVER['X-Real-IP'] ) ? $_SERVER['X-Real-IP'] : 'no-ip';
    // Sucuri
    echo isset( $_SERVER['HTTP_X_SUCURI_CLIENTIP'] ) ? $_SERVER['HTTP_X_SUCURI_CLIENTIP'] : 'no-ip';
    // Ezoic
    echo isset( $_SERVER['X-FORWARDED-FOR'] ) ? $_SERVER['X-FORWARDED-FOR'] : 'no-ip';
    // akamai
    echo isset( $_SERVER['True-Client-IP'] ) ? $_SERVER['True-Client-IP'] : 'no-ip';
    // Clouways
    echo isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : 'no-ip';

    once you know which one is returning real IP in ipv4 format add the following to your functions.php. Example with $_SERVER[‘X-FORWARDED-FOR’]

    add_filter( 'geot/user_ip', function(){
     return $_SERVER['X-FORWARDED-FOR'];
    });

    hi, thanks for your reply.
    has something to do with cloudfalre.
    even with: define('GEOT_CLOUDFLARE',true); is the same.
    without cloudflare is no error.

    thnaks

    I have the exact same issue. Was this resplved yet, because I’d like to know what I need to do to get it working so I can decide if I want the premium version.

    Plugin Author Damian

    (@timersys)

    Hi @nwdlv, did you followed the instructions on my first message regarding to check what IP is being returned by your server?

    Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Warning: inet_pton() error’ is closed to new replies.