문제

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