GeoIP
The GeoIP extension allows you to find the location of an IP address, including the city, state, country, latitude, and longitude.
To install this extension, run the following command as your server's root user:
sudo apt-get install gcc make autoconf libc-dev pkg-config sudo apt-get install libgeoip-dev sudo pecl5.X-sp install geoip
Once installed, create a configuration file for the extension and restart PHP by running the following command as root
sudo bash -c "echo extension=geoip.so > /etc/php5.X-sp/conf.d/geoip.ini" sudo service php5.X-fpm-sp restart
You can check that it was installed with the command:
php5.X-sp -i | grep geoip
The output will look like this:
$ php5.5-sp -i | grep geoip /etc/php5.5-sp/conf.d/geoip.ini, geoip geoip support => enabled geoip extension version => 1.0.8 geoip library version => 1004008 geoip.custom_directory => no value => no value
Installing GeoIP on PHP 7.0
The GeoIP extension does not currently work with PHP 7.0. If you attempt to install it on PHP 7.0, you will encounter errors building the extension. As soon as the extension is updated to work with PHP 7.0, you will be able to install it.
Alert: For Control Panel Help & Tutorials, click here: Panel Tutorials