PHPackages                             neto737/geoip2-update - 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. neto737/geoip2-update

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

neto737/geoip2-update
=====================

Update GeoIP2/GeoLite2 databases from your script, program or via composer.

v1.0.0(today)00MITPHPPHP ^8.3

Since Jun 13Pushed todayCompare

[ Source](https://github.com/neto737/geoip2-update)[ Packagist](https://packagist.org/packages/neto737/geoip2-update)[ Docs](https://github.com/neto737/geoip2-update)[ RSS](/packages/neto737-geoip2-update/feed)WikiDiscussions main Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

GeoIP2 Update
=============

[](#geoip2-update)

Update GeoIP2/GeoLite2 databases from your PHP script or automatically via Composer.

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

[](#requirements)

- PHP **8.3+**
- `ext-curl`
- `ext-zip` *(only required for CSV database editions)*
- A valid [MaxMind license key](https://support.maxmind.com/account-faq/license-keys/where-do-i-find-my-license-key/)

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

[](#installation)

```
composer require neto737/geoip2-update
```

Usage
-----

[](#usage)

### 1. Automatic updates via Composer

[](#1-automatic-updates-via-composer)

Add the configuration to your project's `composer.json`. The databases will be checked and updated every time `composer update` or `composer update neto737/geoip2-update` runs.

```
{
    "scripts": {
        "post-update-cmd": "neto737\\GeoIP2Update\\ComposerClient::run"
    },
    "extra": {
        "neto737\\GeoIP2Update\\ComposerClient::run": {
            "license_key": "YOUR_LICENSE_KEY",
            "dir": "@composer/../geoip2"
        }
    }
}
```

The `@composer` token is replaced with the directory of your `composer.json` file.

### 2. Programmatic updates from PHP

[](#2-programmatic-updates-from-php)

```
use neto737\GeoIP2Update\Client;

$client = new Client([
    'license_key' => 'YOUR_LICENSE_KEY',
    'dir'         => '/path/to/geoip2',
    'editions'    => ['GeoLite2-ASN', 'GeoLite2-City', 'GeoLite2-Country'],
]);

$client->run();

foreach ($client->updated() as $message) {
    echo $message . PHP_EOL;
}

foreach ($client->errors() as $error) {
    echo 'Error: ' . $error . PHP_EOL;
}
```

### 3. Loading the configuration from a GeoIP.conf file

[](#3-loading-the-configuration-from-a-geoipconf-file)

```
$client = new Client([
    'geoipConfFile' => '/etc/GeoIP.conf',
    'dir'           => '/path/to/geoip2',
]);

$client->run();
```

The `GeoIP.conf` file is the standard MaxMind configuration format:

```
AccountID  12345
LicenseKey YOUR_LICENSE_KEY
EditionIDs GeoLite2-ASN GeoLite2-City GeoLite2-Country

```

Configuration options
---------------------

[](#configuration-options)

OptionTypeDescription`license_key``string`Your MaxMind license key`dir``string`Directory where database files will be stored`editions``string[]`List of edition IDs to update (see below)`geoipConfFile``string`Path to a `GeoIP.conf` file (sets `license_key` and `editions`)Supported editions
------------------

[](#supported-editions)

Edition IDFormat`GeoLite2-ASN`MMDB`GeoLite2-City`MMDB`GeoLite2-Country`MMDB`GeoIP2-ASN`MMDB`GeoIP2-City`MMDB`GeoIP2-Country`MMDB`GeoLite2-ASN-CSV`ZIP`GeoLite2-City-CSV`ZIP`GeoLite2-Country-CSV`ZIP`GeoIP2-ASN-CSV`ZIP`GeoIP2-City-CSV`ZIP`GeoIP2-Country-CSV`ZIPCSV editions require `ext-zip`.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bf38d9675a95dfdd8b4b401459be6ef7c0342ea40359f23772a0c3ad2feae12b?d=identicon)[neto737](/maintainers/neto737)

---

Tags

geoipgeolocationmaxmindgeoip2geolite2

### Embed Badge

![Health badge](/badges/neto737-geoip2-update/health.svg)

```
[![Health](https://phpackages.com/badges/neto737-geoip2-update/health.svg)](https://phpackages.com/packages/neto737-geoip2-update)
```

###  Alternatives

[geoip2/geoip2

MaxMind GeoIP PHP API

2.5k89.6M339](/packages/geoip2-geoip2)[maxmind-db/reader

MaxMind DB Reader API

698104.5M56](/packages/maxmind-db-reader)[tronovav/geoip2-update

Update GeoIP2/GeoLite2 databases from your script, program or via composer.

50340.0k1](/packages/tronovav-geoip2-update)

PHPackages © 2026

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