How to install the GeoIp2 library

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
20,055
Points
823

Reputation:

Some add-ons have an option to use the GeoIp2 library which is installed on your server. This GeoIp2 library allows reading the GeoLite2 database. Once installed you will be able to make as many IP lookups for free.

Installation instructions
  1. Create a directory called misc in your public_html directory.
  2. Log into your server using SSH. Log in as a cPanel user or equivalent (do not log in as root).
  3. Navigate to the /misc directory.
  4. Enter the following command composer require geoip2/geoip2:~2.
  5. Composer will install the GeoIp2 library.
A new directory called vendor contains the files needed to use GeoIp2 library.

Example of the vendor directory.
1706842640149.jpg


In order to use the GeoIp2 library, you will need to download the GeoLite2-City.mmdb database. First step is to register at the maxmind.com site:

https://www.maxmind.com/en/geolite2/signup

Then go to the downloads page here:

https://www.maxmind.com/en/accounts/729461/geoip/downloads

Download the GZIP file.
1654951425003.png

Unpack the GZIP file and upload the GeoLite2-City.mmdb file to your /misc directory on your server. Last step is to update the add-ons options page with the path to the autoload.php and GeoLite2-City.mmdb files.
 
Top