The Aerospike PHP Client works with PHP 5.3.3+, 5.4, 5.5, and 5.6.
The PHP extension was tested to build on 64-bit
- Ubuntu 12.04 LTS, 14.04 LTS, Debian 6, 7, 8 and related distros using the apt package manager
- CentOS 6.x, 7.x, RedHat 6.x, 7.x and related distros using the yum package manager
- OS X 10.9 (Mavericks), 10.10 (Yosemite)
Windows is currently not supported.
Documentation of the Aerospike PHP 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 yum groupinstall "Development Tools"
sudo yum install openssl-devel
sudo yum install php-devel php-pear # unless PHP was manually installed
sudo apt-get install build-essential autoconf libssl-dev
sudo apt-get install php5-dev php-pear # unless PHP was manually installed
By default OS X will be missing command line tools. On Mavericks (OS X 10.9) and higher those can be installed without Xcode.
xcode-select --install # install the command line tools, if missing
The dependencies can be installed through the OS X package manager Homebrew.
brew update && brew doctor
brew install automake
brew install openssl
To switch PHP versions see this gist.
Using Composer you can download and build the PHP extension:
composer require aerospike/aerospike-client-php "*"
find vendor/aerospike/aerospike-client-php/ -name "*.sh" -exec chmod +x {} \;
cd vendor/aerospike/aerospike-client-php/ && composer run-script post-install-cmd
To build the PHP extension manually you will need to fetch the
latest release
from Github, then run the build.sh
script in the src/aerospike/
directory.
cd src/aerospike
./build.sh
This will download the Aerospike C client SDK if necessary into
src/aerospike-client-c/
, and initiate make
.
To install the PHP extension do:
sudo make install
php -i | grep ".ini "
Now edit the php.ini file. If PHP is configured --with-config-file-scan-dir
(usually set to /etc/php.d/
) you can create an aerospike.ini
file in the
directory, otherwise edit php.ini
directly. Add the following directive:
extension=aerospike.so
aerospike.udf.lua_system_path=/path/to/client-php/sys-lua
aerospike.udf.lua_user_path=/path/to/client-php/usr-lua
The aerospike module should now be available to the PHP CLI:
php -m | grep aerospike
aerospike
Remember that if you are using PHP with Nginx or Apache there is likely a
separate php.ini
config file for the web server Copy the aerospike.ini
you have just created into /etc/php5/apache2/conf.d/
, /etc/php5/fpm/conf.d/
or wherever the configuration include directory of the web server is, then issue
a graceful restart.
The Aerospike PHP Client is made availabled under the terms of the Apache License, Version 2, as stated in the file LICENSE.
Individual files may be made available under their own specific license, all compatible with Apache License, Version 2. Please see individual files for details.