Does anyone have any idea why my server cannot read the database file?
No matter what I try, I keep getting the same error:
‘Can not open GeoLiteCity.dat’
No explanation. The file is there, i’ve tried uploading to make sure it wasn’t corrupt. I’m using the pure php module. Both files are in the same directory…
I’m trying to set this up on wordpress, might that be part of the issue?
my code is just the basic tester:
include("geoip.inc");
// read GeoIP database
$handle = geoip_open("GeoLiteCity.dat", GEOIP_STANDARD);
// map IP to country
echo "IP address 62.149.130.132 located in " . geoip_country_name_by_addr($handle, "62.149.130.132") . " (country code " . geoip_country_code_by_addr($handle, "62.149.130.132") . ")";
// close database handler
geoip_close($handle);
but it just wont do it.
1 Answer