Title: PHP Warning: inet_pton() error
Last modified: October 22, 2016

---

# PHP Warning: inet_pton() error

 *  [Marius](https://wordpress.org/support/users/mmichtus/)
 * (@mmichtus)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/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](https://wordpress.org/support/users/timersys/)
 * (@timersys)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/php-warning-inet_pton-error/#post-8354957)
 * 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'];
       });
       ```
   
 *  Thread Starter [Marius](https://wordpress.org/support/users/mmichtus/)
 * (@mmichtus)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/php-warning-inet_pton-error/#post-8366252)
 * 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
 *  [nwdlv](https://wordpress.org/support/users/nwdlv/)
 * (@nwdlv)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/php-warning-inet_pton-error/#post-8428975)
 * 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](https://wordpress.org/support/users/timersys/)
 * (@timersys)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/php-warning-inet_pton-error/#post-8443294)
 * Hi [@nwdlv](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/geotargeting/assets/icon-256x256.png?rev=1829366)
 * [GeoTargeting Lite - WordPress Geolocation](https://wordpress.org/plugins/geotargeting/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/geotargeting/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/geotargeting/)
 * [Active Topics](https://wordpress.org/support/plugin/geotargeting/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/geotargeting/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/geotargeting/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Damian](https://wordpress.org/support/users/timersys/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/php-warning-inet_pton-error/#post-8443294)
 * Status: not resolved