ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

IP to Nation module is not functioning or updating

January 28, 2013 8:08pm

Subscribe [2]
  • #1 / Jan 28, 2013 8:08pm

    nathanzachary

    11 posts

    Hello all,

    Some time ago, we had to disable the IP to Nation module, which caused our store to stop automatically redirecting visitors to the correct section based on their IP.  We would like to get this functionality back, and I have been investigating possible causes for the problem.

    What I have found thus far is:

    1. A manual update of the IP to Nation database hangs on the following message:

    Unpacked IP Database. Inserting data ..

    2.  The corresponding table shows incorrect data for two pertinent columns:

    mysql> SELECT * FROM exp_ip2nation;
    +--------+--------------+---------------+---------+
    | id     | ip_range_low | ip_range_high | country |
    +--------+--------------+---------------+---------+
    |      1 | 0            | 0             | at      |
    |      2 | 0            | 0             | au      |
    |      3 | 0            | 0             | cn      |
    |      4 | 0            | 0             | au      |
    |      5 | 0            | 0             | cn      |
    |      6 | 0            | 0             | jp      |
    |      7 | 0            | 0             | cn      |
    |      8 | 0            | 0             | jp      |
    |      9 | 0            | 0             | th      |
    |     10 | 0            | 0             | cn      |
    |     11 | 0            | 0             | au      |
    |     12 | 0            | 0             | cn      |
    |     13 | 0            | 0             | jp      |
    |     14 | 0            | 0             | th      |
    |     15 | 0            | 0             | cn      |
    |     16 | 0            | 0             | au      |
    |     17 | 0            | 0             | cn      |
    |     18 | 0            | 0             | th      |
    |     19 | 0            | 0             | cn      |
    |     20 | 0            | 0             | au      |

    The above is just a snippet, but the entire table has 0 values for both ‘ip_range_low’ and ‘ip_range_high’.

    3.  I have manually downloaded the GeoIPCountryCSV.zip file which is mentioned in the following section of system/expressionengine/modules/ip_to_nation/mcp.ip_to_nation.php:

    // download
                    $files = array(
                            'http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip',
                            'http://geolite.maxmind.com/download/geoip/database/GeoIPv6.csv.gz'
                    );

    The extracted CSV contains the appropriate data that are to be injected into the columns of the exp_ip2nation table.

    4.  PHP has zip and gzip support enabled, as both of the files are extracted to the cache folder without problem.

    If anyone has suggestions for further troubleshooting, please let me know.

    Cheers,
    Nathan Zachary

  • #2 / Feb 18, 2013 12:41am

    radiosystems

    1 posts

    We’re having the same issue on our installation. I don’t have old copies of the files maxmind used to serve, but I suspect something about the format or encoding has changed.

    Best I can tell the versions the updater just processed for me are encoded in ANSI. According to the php manual for fgetcsv (used in the update code), if your LANG is set to utf8, the function will read files with one-byte encoding (like ANSI) incorrectly.
    http://php.net/manual/en/function.fgetcsv.php

    I haven’t resolved it yet. Please keep this thread updated if you find a resolution.

    Everett

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases