PHPackages                             daigo75/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. daigo75/geoip

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

daigo75/geoip
=============

Fork of MaxMind GeoIP PHP API with improved error handling

v1.24(12y ago)0137LGPL 2.1+PHP

Since May 27Pushed 12y ago1 watchersCompare

[ Source](https://github.com/daigo75/geoip-api-php)[ Packagist](https://packagist.org/packages/daigo75/geoip)[ Docs](http://dev.maxmind.com/geoip/legacy/downloadable)[ RSS](/packages/daigo75-geoip/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (14)Used By (0)

MaxMind GeoIP PHP API
=====================

[](#maxmind-geoip-php-api)

Requirements
------------

[](#requirements)

This module has no external dependencies. You only need a MaxMind GeoIP database. To download a free GeoIP Standard Country database, please see our [GeoLite page](http://dev.maxmind.com/geoip/geolite).

Installing with Composer
------------------------

[](#installing-with-composer)

### Define Your Dependencies

[](#define-your-dependencies)

We recommend installing this package with [Composer](http://getcomposer.org/). To do this, add `geoip/geoip` to your `composer.json` file.

```
{
    "require": {
        "daigo75/geoip": "~1.14"
    }
}
```

### Install Composer

[](#install-composer)

Run in your project root:

```
curl -s http://getcomposer.org/installer | php

```

### Install Dependencies

[](#install-dependencies)

Run in your project root:

```
php composer.phar install

```

### Require Autoloader

[](#require-autoloader)

You can autoload all dependencies by adding this to your code:

```
require 'vendor/autoload.php';

```

Installing without Composer
---------------------------

[](#installing-without-composer)

Place the 'geoip.inc' file in the `include_path` as specified in your `php.ini` file or place it in the same directory as your PHP scripts.

Usage
-----

[](#usage)

Gets country name by hostname :

```
