Download the PHP package ndevs-eu/geo-ip-bundle without Composer
On this page you can find all versions of the php package ndevs-eu/geo-ip-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package geo-ip-bundle
π NDevs GeoIP Bundle
Symfony bundle for detecting user geolocation based on IP address.
Supports MaxMind GeoLite2 and IP2Location, with optional fallback, mock IP in dev mode, and automatic request listener.
βοΈ Installation
π Configuration structure (config/packages/geo_ip.yaml)
In
devenvironment you can add a mock IP for testing:
π§ͺ Usage in code
β Accessing geo data
The listener injects
geoIpattribute into each request when enabled.
π Downloading databases
π₯ MaxMind (GeoLite2 City)
- Register at maxmind.com
- Get your
License Key - Download database manually or run:
π₯ IP2Location (Lite BIN)
- Get free version
- Download manually or run:
Make sure the path in your config matches the location of extracted files.
π§ͺ Mocking IP in dev
To test without relying on real headers:
π§° Available Console Commands
| Command | Description |
|---|---|
geoip:pull-maxmind-database |
Downloads the latest MaxMind GeoIP DB |
geoip:pull-ip2loc-lite-database |
Downloads the latest IP2Location Lite DB |
β Requirements
- PHP 8.1+
- Symfony 6.3+
- Extensions:
ext-jsonext-mbstringext-zipext-curl
- Composer
- MaxMind GeoIP2 (City or Country)
π Features
β
Auto-detects IP from headers (X-Forwarded-For, Cloudflare, etc.)
β
Supports fallback resolver if primary fails
β
Allows IP mocking in dev mode
β
Docker/proxy/CDN-friendly
β
Easy integration via DI
π FAQ
What if the IP is not found?
geoIp attribute will contain null values. No exception is thrown.
What if I donβt use IP2Location?
Just don't define a fallback resolver in config.
π License
MIT
GitAds Sponsored
All versions of geo-ip-bundle with dependencies
symfony/framework-bundle Version ^6.4 || ^7.0
geoip2/geoip2 Version ^3.2
ip2location/ip2location-php Version ^9.7