GeoIP extension for HipHop VM (HHVM HNI DSO)
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

GeoIP (geoip) Extension for HHVM

This is a port of the PECL geoip extension for HipHop Virtual Machine.

Note: you will need to build this extension from source. Due to the number of platforms supported by HHVM, I am unable to provide binaries.


This extension requires the <GeoIP.h> and <GeoIPCity.h> header files and libGeoIP library installed.

On Ubuntu 12.04, you need to install the "libgeoip-dev" and "libgeoip1" packages.

Building & Installation

Requires HHVM 3.0 or later.

If you have already built hhvm from source, build the file (the dynamically-loadable extension) using:

$ export HPHP_HOME=/path/to/hhvm
$ cd /path/to/extension
$ ./

To build this extension without the hhvm source, try:

$ sudo apt-get install hhvm-dev libgeoip-dev
$ sudo chmod +x /usr/bin/hphpize
$ git clone
$ cd hhvm-ext-geoip
$ hphpize
$ cmake .
$ make

To enable the extension, you need to have the following section in your PHP ini file:

hhvm.dynamic_extension_path = /path/to/hhvm/extensions
hhvm.dynamic_extensions[geoip] =

Note: To enable the extension on older HHVM versions, you will instead have the following section in your HHVM config file:

DynamicExtensionPath = /path/to/hhvm/extensions
DynamicExtensions {
        * =

Where /path/to/hhvm/extensions is a folder containing all HHVM extensions, and is in it. This will cause the extension to be loaded when the virtual machine starts up.


To run the test suite:

$ cd /path/to/extension
$ ./ run-tests.php