Registry / networking / geoip2-geoip2

geoip2-geoip2

JSON →
library3.3.0phppackagistunverified

MaxMind GeoIP PHP API.

composer require geoip2/geoip2
INSTALL
IMPORT
SIG · GEOIP2-GEOIP2
G
geoip2-geoip2
networkingphpv3.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Reader
✓ use GeoIp2\Database\Reader;

Look up IP address location using a GeoIP2 database.

use GeoIp2\Database\Reader; $reader = new Reader('/path/to/GeoLite2-City.mmdb'); $record = $reader->city('128.101.101.101'); echo $record->country->name; // 'United States'
Debug
Known issues
gotchaRequires a MaxMind database file (not included).
fix
Download a free GeoLite2 database from MaxMind.
affects: *
Upgrade
Version history
3.3.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
geoip2-geoip2 — pip install geoip2-geoip2 · libregistry