switch hosting, now geo-redirect doesnt work

switched over to beyond hosting, and now my geo-redirection script doesnt work.

this is the script I WAS using


if(isset($_SERVER[‘REMOTE_ADDR’])) {
$gi = geoip_open(‘geoip/GeoIP.dat’,GEOIP_STANDARD);
$country = geoip_country_code_by_addr($gi,$_SERVER[‘REMOTE_ADDR’]);
}else {
$country = ”;

if($country==’US’) {
}else {


with maxminds geoip.dat and files in the same folder. It worked perfectly fine until I switched hosting. This is the error I get:

"Fatal error: Cannot redeclare geoip_country_code_by_name() in /geoip/ on line 346"

anybody have any idea what I can do? Facebook reviewers have been disapproving all my ads lately cause they are too lazy to look at it from the country that I am advertising it ins ip address

User Comment:
– Open the file
– Search for the geoip_country_code_by_name function
– Put this function between the following code:

if (!function_exists(‘geoip_country_code_by_name’)) {

User Comment:
We have the geoip module loaded on our servers, I think the file your loading is trying to load the module again under your suexec env. I remember a ticket about this recently, may have been you, may not.

Anyway, if you didn’t get it working bump a ticket we will take care of ya!

The Article Published IN 08-03-2011 08:02 PM

Share To More ()