This is the official release maintained by IP2Location.com
This PHP module provides fast lookup of country, region, district, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection speed, IDD code, area code, weather station code, weather station name, MNC, MCC, mobile brand, elevation, usage type, address type, IAB category and ASN from IP address by using IP2Location database. This module uses a file based database available at IP2Location.com.
This module can be used in many types of projects such as:
Free IP2Location LITE and commerical databases are available for download.
Monthly update is available for both IP2Location LITE and commercial database.
To learn more about installation, usage, and code examples, please visit the developer documentation at https://ip2location-php.readthedocs.io/en/latest/index.html.
This library requires IP2Location BIN data file to function. You may download the BIN data file at
An outdated BIN database was provided in the databases folder for your testing. You are recommended to visit the above links to download the latest BIN database.
You can also sign up for IP2Location Web Service to lookup by IP2Location API.
php ip2location_bin_download.php --token DOWNLOAD_TOKEN --file DATABASE_CODE -y
The command above will download the DATABASE_CODE BIN file and unzip the file into data folder.
Parameters | Description |
---|---|
token | Download token. You can get your token at your IP2Location Account Area at the Download page. |
file | Database package. (DB1BIN...DB26BIN, DB1BINIPV6...DB26BINIPV6, DB1LITEBIN...DB11LITEBIN or DB1LITEBINIPV6...DB11LITEBINIPV6) You may login to your IP2Location Account Area and get the package code (or download code) at the Download page. |
y | Auto replace the current BIN file without acknowledgement. |
You can set the DOWNLOAD_TOKEN and DATABASE_CODE with values in the .env file (same path as ip2location_bin_download.php) and run the command php ip2location_bin_download.php
for the download.
Below are the list of other framework library that you can install and use right away.
Copyright (C) 2005-2024 by IP2Location.com
License under MIT