yum install GeoIP-devel yum install php-pear yum install php-pecl-geoip cd /usr/share/GeoIP wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz gunzip GeoIP.dat.gz gunzip GeoLiteCity.dat.gz mv GeoLiteCity.dat GeoIPCity.dat sudo systemctl restart php-fpm sudo systemctl restart nginx
TEST PHP CODE
$record = geoip_record_by_name($_SERVER["REMOTE_ADDR"]); if ($record) { print_r($record); }
Comment feed