Question

The code is:

if (!geoip_db_avail(GEOIP_COUNTRY_EDITION)) 
        {
            //do this
        }

and it is throwing a:

Caught fatal error: Call to undefined function geoip_db_avail()

in one of my applications.

On a test on another site on the same server using:

$country_name = apache_note("GEOIP_COUNTRY_NAME");
print "What: " . $country_name;

if (geoip_db_avail(GEOIP_COUNTRY_EDITION)) 
{
        print "NO!";
}
else
{
        print "YE";
}

It does not show the error but all the page prints is:

What: Pakistan

It does not print Ye or NO!

Was it helpful?

Solution

Manual is your friend. This function is declared in PECL geoip extension which is installed on one of your servers but not on another.

You can read here about installation and requirements.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top