a6e6s / slimstat

Automatically exported from code.google.com/p/slimstat
GNU General Public License v2.0
1 stars 0 forks source link

Fatal error with GeoIP php module installed #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Fatal error: Cannot redeclare geoip_country_code_by_name() in
/slimstat/_lib/geoip.php on line 348

To fix this, replace

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;
}
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;
}

with

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;
    }
}
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;
    }
}

in /slimstat/_lib/geoip.php on line 348

Original issue reported on code.google.com by Gle...@gmail.com on 3 Oct 2009 at 1:58

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r27.

Original comment by step...@wettone.com on 5 Oct 2009 at 9:39

GoogleCodeExporter commented 9 years ago
Thanks, that solved the problem.

Original comment by f.weijen...@d-media.nl on 5 Feb 2010 at 3:53

GoogleCodeExporter commented 9 years ago
 GlebTv thanks for your suggestion! I appended your lines and it fixed my problem ;) 

For me it was PHP Fatal error:  Cannot redeclare geoip_country_code_by_name() 
in geoip.inc on line 390

thanks again

Original comment by mwillem...@gmail.com on 22 Aug 2010 at 7:19

GoogleCodeExporter commented 9 years ago
Thanks!! That solved my problem too! 

Server error code 500 - Log files: PHP Fatal error:  Cannot redeclare 
geoip_country_code_by_name() in geoip.inc on line 438;

Original comment by m.gol...@gmx.de on 21 Aug 2013 at 9:28