PHPackages                             librarymarket/maxmind-db-reader - 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. [Database &amp; ORM](/categories/database)
4. /
5. librarymarket/maxmind-db-reader

ActiveLibrary[Database &amp; ORM](/categories/database)

librarymarket/maxmind-db-reader
===============================

An unofficial library to facilitate reading the MaxMind database file format.

1.0.1(3y ago)030.5k—7.7%MITPHPPHP &gt;=7.3

Since Feb 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/librarymarket/maxmind-db-reader)[ Packagist](https://packagist.org/packages/librarymarket/maxmind-db-reader)[ Docs](https://github.com/librarymarket/maxmind-db-reader)[ RSS](/packages/librarymarket-maxmind-db-reader/feed)WikiDiscussions 1.1.x Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (0)

MaxMind DB Reader
=================

[](#maxmind-db-reader)

[![PHPStan](https://github.com/librarymarket/maxmind-db-reader/workflows/PHPStan/badge.svg)](https://github.com/librarymarket/maxmind-db-reader/workflows/PHPStan/badge.svg)[![Maintainability](https://camo.githubusercontent.com/9ac85ed960e35a21f2a884de7ca799dc0200cc78b0cc391c5239620d05a6ef0c/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31383663633165383836386364646161636363642f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/librarymarket/maxmind-db-reader/maintainability)

An unofficial library to facilitate reading the MaxMind database file format.

Why?
----

[](#why)

MaxMind's open source PHP library for reading `*.mmdb` files is incompatible with the GNU General Public License, version 2. Because of this, we decided to implement our own database reader based off of MaxMind's open file format specifications and their Ruby library for the same purpose (which was dual-licensed under MIT at the time this library was written).

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

[](#requirements)

`ext-bcmath` or `ext-gmp` may be required for decoding unsigned integers of more than 31 bits in length, but this depends on the contents of the database you're trying to read.

Usage
-----

[](#usage)

1. Create an instance of the database reader by providing the path to your MaxMind database file on disk.
2. Invoke `Reader::searchForAddress(string $ip_address, int &$depth = 0): array`to retrieve information about the IP address from the database.
    - If the IP address wasn't found in the database, an empty array is returned.
    - If the optional second argument is supplied, it will be populated with the bit depth at which the address was found. This is the netmask of the resulting information.

```
$reader = new \LibraryMarket\MaxMind\Database\Reader('/path/to/database.mmdb');

// Search for an IP address in human-readable format.
$reader->searchForAddress('127.0.0.1');
$reader->searchForAddress('::1');
```

License
-------

[](#license)

Copyright (c) 2022 Library Solutions, LLC (et al.).

This is free software, licensed under the MIT License. See `LICENSE.txt` in this project's root directory for the full license text.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~28 days

Recently: every ~36 days

Total

6

Last Release

1417d ago

PHP version history (2 changes)1.0.0-alpha1PHP &gt;=7.3

1.1.x-devPHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/23ac013c9e01441cfb5d67ed6cacc41a7d155f24f41bec16eb04ac10f8423d9f?d=identicon)[clayfreeman](/maintainers/clayfreeman)

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

---

Top Contributors

[![clayfreeman](https://avatars.githubusercontent.com/u/182658?v=4)](https://github.com/clayfreeman "clayfreeman (11 commits)")

---

Tags

databasemaxmindreaderdb

### Embed Badge

![Health badge](/badges/librarymarket-maxmind-db-reader/health.svg)

```
[![Health](https://phpackages.com/badges/librarymarket-maxmind-db-reader/health.svg)](https://phpackages.com/packages/librarymarket-maxmind-db-reader)
```

###  Alternatives

[robmorgan/phinx

Phinx makes it ridiculously easy to manage the database migrations for your PHP app.

4.5k46.2M405](/packages/robmorgan-phinx)[maxmind-db/reader

MaxMind DB Reader API

69799.2M47](/packages/maxmind-db-reader)[spatie/laravel-translation-loader

Store your language lines in the database, yaml or other sources

8362.9M51](/packages/spatie-laravel-translation-loader)[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[envms/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

925511.7k13](/packages/envms-fluentpdo)[lichtner/fluentpdo

FluentPDO is a quick and light PHP library for rapid query building. It features a smart join builder, which automatically creates table joins.

921274.8k6](/packages/lichtner-fluentpdo)

PHPackages © 2026

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