PHPackages                             izisoft/yii2-geoip - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. izisoft/yii2-geoip

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

izisoft/yii2-geoip
==================

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

v3.0(7y ago)038MITPHP

Since Nov 13Pushed 5y ago1 watchersCompare

[ Source](https://github.com/izisoft/yii2-geoip)[ Packagist](https://packagist.org/packages/izisoft/yii2-geoip)[ Docs](https://iziweb.net)[ RSS](/packages/izisoft-yii2-geoip/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (24)Used By (0)

Yii2 GeoIP
==========

[](#yii2-geoip)

Yii2 Component to allow for easy usage of the MaxMind Free dbs.

Based on package phiphi1992/Yii2-GeoIP by Phi Hoang Xuan.

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require izisoft/yii2-geoip "~2.0.0"

```

or add

```
"izisoft/yii2-geoip": "~2.0.0"

```

to the require section of your `composer.json` file.

Version ~2.0.0 Difference
-------------------------

[](#version-200-difference)

Version ~2.0.0 uses the new GeoLite2 version of the db instead of the Legacy GeoLite which is now deprecated.

Database can be found here:

Component Setup
---------------

[](#component-setup)

Once the extension is installed, simply modify your application configuration as follows:

```
return [
    'components' => [
    ...
        'geoip' => [
                   'class' => 'izi\geoip\components\CGeoIP',
               ],
        ...
    ],
    ...
];
```

If querying full City data is required, yii2-geoip-city-db must be required as well, see [izisoft/yii2-geoip-city-db](https://github.com/izisoft/yii2-geoip-city-db).

For more information on the data availability, see below.

Usage
-----

[](#usage)

All methods accept an IP address as an argument. If no argument is supplied Yii::$app-&gt;getRequest()-&gt;getUserIP() is used.

```
//Along with free DB
$location = Yii::$app->geoip->lookupLocation();
$countryCode = Yii::$app->geoip->lookupCountryCode();
$countryName = Yii::$app->geoip->lookupCountryName();

```

Location attributes:

```
$location->countryCode //Available in both Country and City DB
$location->countryName //Available in both Country and City DB
$location->continentCode //Available in both Country and City DB
$location->continentName //Available in both Country and City DB
$location->city //Available in only City DB
$location->postalCode //Available in only City DB
$location->latitude //Available in only City DB
$location->longitude //Available in only City DB
$location->timeZone //Available in only City DB

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~49 days

Recently: every ~28 days

Total

23

Last Release

2754d ago

Major Versions

1.3.9 → 2.0.02018-06-12

2.0.7 → v3.02018-10-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/2edf0df855a366ea51f96bd910a60c87320c973460ccc273a7e448ae32eedb65?d=identicon)[zinzinx8](/maintainers/zinzinx8)

---

Top Contributors

[![zinzinx8](https://avatars.githubusercontent.com/u/13455399?v=4)](https://github.com/zinzinx8 "zinzinx8 (21 commits)")[![sionghuat](https://avatars.githubusercontent.com/u/13095881?v=4)](https://github.com/sionghuat "sionghuat (20 commits)")[![darrenng-dpodium](https://avatars.githubusercontent.com/u/12998063?v=4)](https://github.com/darrenng-dpodium "darrenng-dpodium (9 commits)")

---

Tags

geoipmaxmindyii2extension

### Embed Badge

![Health badge](/badges/izisoft-yii2-geoip/health.svg)

```
[![Health](https://phpackages.com/badges/izisoft-yii2-geoip/health.svg)](https://phpackages.com/packages/izisoft-yii2-geoip)
```

###  Alternatives

[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
