September 1, 2013
Location of GeoIP.dat for PHP
To find the location of GeoIP for PHP you can ssh into the server and use the “find” command.
find / -iname GeoIP.dat
Will return a list of file paths where the file with this name is found. In my case I found:
/usr/share/GeoIP/GeoIP.dat /usr/local/share/GeoIP/GeoIP.dat /opt/geoip/share/GeoIP/GeoIP.dat
In my case the bottom link was the one that PHP was searching for, To confirm this i moved the file and PHP started to complain that it couldn’t find the file.
Previously because I was updating the wrong file it didn’t update my install so PHP was returning old and wrong data.