WordPress.org

Ready to get started?Download WordPress

Forums

iQ Block Country
[resolved] [SOLVED]Cannot redeclare geoip_country_code_by_name() in geoip.inc on line 438 (4 posts)

  1. danicra
    Member
    Posted 10 months ago #

    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/

  2. Pascal
    Member
    Plugin Author

    Posted 10 months ago #

    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?

  3. danicra
    Member
    Posted 10 months ago #

    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.

  4. jamesmoney
    Member
    Posted 6 months ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.