PHPackages                             user1007017/yii2-geoip2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. user1007017/yii2-geoip2

ActiveYii2-extension

user1007017/yii2-geoip2
=======================

Yii2 GeoIP2 extension. Returns country, city, latitude, longitude, time zone, iso code, continent, subdivisions by IP (uses MaxMind's GeoIP2 databases)

1.0.1(9y ago)06MITPHPPHP &gt;=5.4.0

Since Dec 3Pushed 9y agoCompare

[ Source](https://github.com/user1007017/yii2-geoIP2)[ Packagist](https://packagist.org/packages/user1007017/yii2-geoip2)[ RSS](/packages/user1007017-yii2-geoip2/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (3)Used By (0)

Yii2 GeoIP2 extension
=====================

[](#yii2-geoip2-extension)

Subdivisions lng error in Result.php.

See commented code.

```
PHP Notice 'yii\base\ErrorException' with message 'Undefined index: de'

in /vendor/user1007017/yii2-geoip2/Result.php:89

Stack trace:
#0 /commands/ConsoleController.php(71): user1007017\GeoIP2\Result->__get()
#1 /vendor/yiisoft/yii2/base/InlineAction.php(57): app\commands\ConsoleController->actionIndex()

```

---

Provides information about geographical location of user by IP address.

Currently available:

- Country
- City
- Latitude, Longitude
- Time Zone
- ISO Code
- Continent
- Subdivisions

Installation
------------

[](#installation)

```
$ php composer.phar require user1007017/yii2-geoip2 "~1.0.1"
```

#### OR

[](#or)

Add to your `composer.json`

```
{
    "require": {
        "user1007017/yii2-geoip2": "~1.0.1"
    }
}
```

and run

```
$ composer update
```

Usage
-----

[](#usage)

Update your config file - config/web.php

```
