WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [SOLVED]Cannot redeclare geoip_country_code_by_name() in geoip.inc on line 438

[Resolved] [SOLVED]Cannot redeclare geoip_country_code_by_name() in geoip.inc on line 438

  • danicra

    @danicra

    I’ve moved to a new hosting and I got that error message. I don’t know why but I solved it changing some code. Maybe it can help to someone.

    Original:
    function geoip_country_code_by_name($gi, $name) {
    $country_id = geoip_country_id_by_name($gi,$name);
    if ($country_id !== false) {
    return $gi->GEOIP_COUNTRY_CODES[$country_id];
    }
    return false;
    }
    Updated:
    if ( !function_exists (‘geoip_country_code_by_name’)) {
    function geoip_country_code_by_name($gi, $name) {
    $country_id = geoip_country_id_by_name($gi,$name);
    if ($country_id !== false) {
    return $gi->GEOIP_COUNTRY_CODES[$country_id];
    }
    return false;
    }
    }
    Original:
    function geoip_country_name_by_name($gi, $name) {
    $country_id = geoip_country_id_by_name($gi,$name);
    if ($country_id !== false) {
    return $gi->GEOIP_COUNTRY_NAMES[$country_id];
    }
    return false;
    }
    Updated:
    if ( !function_exists( ‘geoip_country_name_by_name’ ) ) {
    function geoip_country_name_by_name($gi, $name) {
    $country_id = geoip_country_id_by_name($gi,$name);
    if ($country_id !== false) {
    return $gi->GEOIP_COUNTRY_NAMES[$country_id];
    }
    return false;
    }
    }

    http://wordpress.org/plugins/iq-block-country/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Pascal

    @iqpascal

    Hi,

    Strange as this should be taken care of by checking of the GeoIP class exists.

    What hosting company did you move to? And did you perhaps also install new plugins?

    danicra

    @danicra

    I’ve used Duplicator plugin to move the site. No new plugins installed. The new hosting is at arvixe. I googled the error and I saw that there are other plugins that report same mistake so I’ve just used their solutions and now works perfect.

    I don’t know enough programming to discover what was the problem.

    I have WordPress at Arvixe and was able to fix this by simply changing the PHP version I use.

    Login to cPanel >> PHP Versions Manager >> click the directory where your WordPress is installed.

    I use “PHP 5.2.17 with Suhosin patch” and the error is gone.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] [SOLVED]Cannot redeclare geoip_country_code_by_name() in geoip.inc on line 438’ is closed to new replies.