So I've installed Supertracker 1.1 on ZC 1.5.1. It worked fine for about a week then I got blank front end (admin is fine). I uninstalled Supertracker and it's good.
The debug logs give this error:
I installed and uninstalled a few times and same result. I have this mod running on 1.3.9h with no problems. It was also OK on this version for about a week.PHP Fatal error: Cannot redeclare geoip_country_code_by_name() in /home/ . . . /public_html/ . . . /includes/geoip.inc on line 351
We've had some strange php errors the last month or so. Little things that I've fixed one at a time. I believe there's some creeping php/mysql upgrade in the works that is running into bad/old/depreciated code.
This issue has happened in the past with this exact error in this file. I've found posts and solutions for this thing from every year for the last 4 years.
This one - adding !if statements in the geoip.inc file - worked for me. the code is around line 340 in geoip.inc.
Fair warning: after I made the code changes and re-uploaded the whole package my front and backend dragged for about 5 mins. Seemed frozen. I waited and refreshed and everything's fine. Supertracker even works
Fatal error: Cannot redeclare geoip_country_code_by_name()
The solution is very simple. in your geoip.inc file, look for this code
function geoip_country_code_by_name($gi, $name) {
...
}
function geoip_country_name_by_name($gi, $name) {
...
}
and replace with
if (!function_exists('geoip_country_code_by_name')) {
function geoip_country_code_by_name($gi, $name) {
...
}
}
if (!function_exists('geoip_country_name_by_name')) {
function geoip_country_name_by_name($gi, $name) {
...
}
}
-------------------------------------------------------
Here are some other solutions I found in case that fix doesn't work for you. I HAVE NOT TRIED THESE
From 2011: this fix from razvantudorica.com/03/cannot-redeclare-geoip_country_code_by_name/. This one is from the same post as the code fix I used: it's an alternative that is supposed to do the same thing.
One person on max_mind says this but I don't know what he's talking about: I don't have that in my php.iniCannot redeclare geoip_country_code_by_name
Fatal error: Cannot redeclare geoip_country_code_by_name()
The reason was that I have geoip extension enabled in my PHP configuration and also I used the geoip.inc file from maxmind.com.
The solution is very simple. Actually, there are two solutions:
First is to disable the geoip extension from your configuration. In /etc/php5/apache2/conf.d/geoip.ini comment the first line:
;extension=geoip.so
. . . . second solution is the code fix above.
From a 2010 posting on 4homepages.de/forum/index.php?topic=28684.0the reason is that you use the php code _and_ the php extension. Remove the geoip extension from your php.ini to fix the namespace clash.
( both use the same function name geoip_country_code_by_name )
Problem solved. It`s depend on hosting changes...
For resolve this problem, uncomment this path in you geoip.inc
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;
Bookmarks