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!

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top