This is a prototype of an Aerospike client implemented as a HHVM Native Interface extension.
Currently builds on 64-bit Ubuntu 14.04 LTS against HHVM 3.9.1, with the aerospike C client release 3.1.16. We intend to support HHVM LTS releases.
Documentation of the Aerospike HHVM Client may be found in the doc directory. The API described there is the specification for the PHP Client. Notes on the internals of the implementation are in doc/internals.md.
Example PHP code can be found in the examples/
directory.
Full documentation of the Aerospike database is available at http://www.aerospike.com/docs/
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449
sudo add-apt-repository "deb http://dl.hhvm.com/ubuntu trusty-lts-3.9 main"
sudo apt-get update
sudo apt-get install -y hhvm
sudo apt-get install -y hhvm-dev
The HHVM manual provides prebuilt packages
for different distributions. You need to install the hhvm
and hhvm-dev
packages.
HHVM requires g++
>= 4.8. The individual distribution links in the
Distro Building Instructions
article explain how to upgrade to this version in older distros such as
Debian 7.
Get the 3.1.16 release of the Aerospike C Client library, and install the development package contained in the tar archive.
For example, on Ubuntu 14.04:
wget -O aerospike-c-client.tgz http://www.aerospike.com/download/client/c/3.1.16/artifact/ubuntu12
tar zxvf aerospike-c-client.tgz
cd aerospike-client-c-3.1.16.ubuntu12.04.x86_64
sudo dpkg -i aerospike-client-c-devel-3.1.16.ubuntu12.04.x86_64.deb
In the cloned repo:
cd src/aerospike
hphpize
cmake . && make
sudo make install
The make install
step should state the path where the extension is installed.
You will use that path in the next step (Configure). On Ubuntu you
will often see the following:
-- Installing: /usr/lib/x86_64-linux-gnu/hhvm/extensions/20150212/aerospike-hhvm.so
If during the build you see an error that complains about the location of Aerospike
header files (for example, fatal error: aerospike/aerospike_key.h: No such file or directory
) you will need to edit the config.cmake
file.
- Edit the target_link_libraries to the path containing the C client
(
libaerospike.so
). - Edit include_directories to the directory which contains the C client's header files.
Add the extension to HHVM by editing /etc/hhvm/php.ini as follows:
hhvm.extensions[] = /path/to/aerospike-hhvm.so
On Ubuntu this is often:
hhvm.extensions[] = /usr/lib/x86_64-linux-gnu/hhvm/extensions/20150212/aerospike-hhvm.so
Run the unit tests as described in the tests section README.