Fatal error call to undefined function geoip_open()

Kalai picture Kalai · Dec 21, 2012 · Viewed 9.1k times · Source

I have installed the geoip for getting the address based on the remote_server ip in php. I have installed the Geoip package in my system and also i have installed the php5-geoip php extension. But while running the following script it is showing the fatal error.

geoip_open("GeoIP.dat",GEOIP_STANDARD);

the error is

Fatal error: Call to undefined function geoip_open()

Answer

Yogesh Suthar picture Yogesh Suthar · Dec 21, 2012

include the geoip_inc file after that it will not show this error and its maxMind librarynot php extension

include("include/geoip.inc");

$gi = geoip_open("include/GeoIP.dat", GEOIP_STANDARD);