PHPackages                             mjphaynes/php-maxmind-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. mjphaynes/php-maxmind-geoip

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

mjphaynes/php-maxmind-geoip
===========================

MaxMind's PHP GeoIP API as a Composer package

1.12.2(10y ago)0227LGPL-2.1+PHP

Since Jan 19Pushed 10y ago1 watchersCompare

[ Source](https://github.com/mjphaynes/php-maxmind-geoip)[ Packagist](https://packagist.org/packages/mjphaynes/php-maxmind-geoip)[ RSS](/packages/mjphaynes-php-maxmind-geoip/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

```
Requirements

None (only the 'GeoIP.dat' file is needed).  To download a free GeoIP Standard Country
database, go to
http://dev.maxmind.com/geoip/geolite

Install

Just place the 'geoip.inc' file somewhere according to the 'include_path' directive of
your 'php.ini' file, or just place it in the same directory as your PHP scripts.

Usage

Gets country name by hostname :

include("geoip.inc");

$gi = geoip_open("/usr/local/share/GeoIP/GeoIP.dat",GEOIP_STANDARD);

echo geoip_country_code_by_addr($gi, "24.24.24.24") . "\t" .
     geoip_country_name_by_addr($gi, "24.24.24.24") . "\n";
echo geoip_country_code_by_addr($gi, "80.24.24.24") . "\t" .
     geoip_country_name_by_addr($gi, "80.24.24.24") . "\n";

geoip_close($gi);

Memory Caching:
To enable memory caching, pass GEOIP_SHARED_MEMORY or
GEOIP_MEMORY_CACHE to the second argument of geoip_open

For GEOIP_SHARED_MEMORY, requires php >= 4.0.4,
and --enable-shmop passed at configure time, see
http://us2.php.net/manual/en/ref.shmop.php
In addition, you should call geoip_load_shared_mem
before calling geoip_open.  See sample_city.php for an
example of shared memory caching.

Working with PHP5.
geoip_country_code_by_addr should work
with PHP.  For help with the other
routines, please contact support@maxmind.com

Thanks to Jim Winstead.
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Unknown

Total

1

Last Release

3763d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/067384af5d03f09088c686e43db1171800800a54fc6e0103d095cd5eb0c167a1?d=identicon)[mjphaynes](/maintainers/mjphaynes)

---

Top Contributors

[![mjphaynes](https://avatars.githubusercontent.com/u/697891?v=4)](https://github.com/mjphaynes "mjphaynes (2 commits)")

### Embed Badge

![Health badge](/badges/mjphaynes-php-maxmind-geoip/health.svg)

```
[![Health](https://phpackages.com/badges/mjphaynes-php-maxmind-geoip/health.svg)](https://phpackages.com/packages/mjphaynes-php-maxmind-geoip)
```

###  Alternatives

[spiral/mcp-server

Spiral bridge for MCP server

541.1k2](/packages/spiral-mcp-server)

PHPackages © 2026

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