PHPackages                             bobey/geoip2-geolite2-composer - 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. bobey/geoip2-geolite2-composer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bobey/geoip2-geolite2-composer
==============================

This tiny repository aims to provide an easy solution to require GeoIP2 / GeoLite2 databases inside your project using composer.

v1.6.0(7y ago)17838.7k↑99.8%21Shell

Since Feb 4Pushed 7y ago1 watchersCompare

[ Source](https://github.com/bobey/geoip2-geolite2-composer)[ Packagist](https://packagist.org/packages/bobey/geoip2-geolite2-composer)[ RSS](/packages/bobey-geoip2-geolite2-composer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)DependenciesVersions (7)Used By (1)

GeoIP2 / GeoLite2 for Composer
==============================

[](#geoip2--geolite2-for-composer)

Description
-----------

[](#description)

This tiny repository aims to provide an easy solution to require GeoIP2 / GeoLite2 databases inside your project using composer. This is particularly usefull if you use it in conjunction with the [GeoIP2 PHP API](https://github.com/maxmind/GeoIP2-php).

Install via composer
--------------------

[](#install-via-composer)

Just run the following command in your project root:

```
composer require bobey/geoip2-geolite2-composer

```

Use it with the GeoIP2 PHP API
------------------------------

[](#use-it-with-the-geoip2-php-api)

```
composer require geoip2/geoip2:~2.0

```

### City Example rewritten

[](#city-example-rewritten)

The following example is the one provided in the [GeoIP2 PHP API](https://github.com/maxmind/GeoIP2-php) README rewritten to lookup the GeoLite2 database inside your vendors directory.

```
