Code Monkey home page Code Monkey logo

hhvm-ext-geoip's Introduction

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.

Prerequisites

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 geoip.so file (the dynamically-loadable extension) using:

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

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 https://github.com/vipsoft/hhvm-ext-geoip.git
$ 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] = geoip.so

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 {
        * = geoip.so
}

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

Testing

To run the test suite:

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

hhvm-ext-geoip's People

Contributors

robocoder avatar adsr avatar kuroneer avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.