PHPackages                             aerospike/aerospike-client-php - 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. [Database &amp; ORM](/categories/database)
4. /
5. aerospike/aerospike-client-php

AbandonedArchivedLibrary[Database &amp; ORM](/categories/database)

aerospike/aerospike-client-php
==============================

The Aerospike PHP client as a C-extension for PHP7

7.5.2(6y ago)29665.4k↓35.6%28[17 issues](https://github.com/aerospike-community/aerospike-client-php/issues)[2 PRs](https://github.com/aerospike-community/aerospike-client-php/pulls)4Apache-2.0PHPPHP ~7.0

Since Sep 11Pushed 2y ago22 watchersCompare

[ Source](https://github.com/aerospike-community/aerospike-client-php)[ Packagist](https://packagist.org/packages/aerospike/aerospike-client-php)[ Docs](http://www.aerospike.com/docs/client/php/)[ RSS](/packages/aerospike-aerospike-client-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (22)Used By (4)

Aerospike PHP Client
====================

[](#aerospike-php-client)

[![License](https://camo.githubusercontent.com/84b6c8a32d15b3312e96ef3fb30936429e4af0cd254f6574b8cc06cb3d4b1973/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6165726f7370696b652f6165726f7370696b652d636c69656e742d7068702e737667)](https://img.shields.io/packagist/l/aerospike/aerospike-client-php.svg)

**Note:** a new PHP 8 compatible client for Aerospike Database is at [aerospike/php-client](https://github.com/aerospike/php-client).

This legacy client supported PHP versions &gt;= 7 . The older client that supported PHP versions up through 5, is at the [aerospike-client-php5 repo](https://github.com/aerospike/aerospike-client-php5)

Differences from the previous Aerospike PHP Client:
---------------------------------------------------

[](#differences-from-the-previous-aerospike-php-client)

- LDT Support has been removed.
- Type checking in general is stricter for method parameters. If you are not sure whether an argument to a function is an integer or a string, we recommend casting it to the type specified by the method. Running with strict\_types enabled may help to catch some issues.
- An exception will be raised if the constructor fails to connect to the cluster.
- \\Aerospike\\Bytes will be stored to the server as type AS\_BYTES\_BLOB instead of AS\_BYTES\_PHP. This change allows better compatability with other clients.
- Correspondingly, data stored in the server as AS\_BYTES\_BLOB will be returned as Aerospike\\Bytes, if no deserializer has been registered. The Previous version of the Aerospike PHP Client returned a string if AS\_BYTES\_BLOB was encountered with no registered deserializer. **Note** It is not recommended to combine the use of \\Aerospike\\Bytes and user specified deserializers, as this may cause errors.
- Support for PHP versions &lt; 7 has been removed.
- The INI entry `aerospike.serializer` now takes an integer value. 0 for No Serializer, 1 for default PHP serialization, and 2 for user specified serializer. See [Configuration](doc/phpdoc/aerospike.php) for additional information on the code values.
- The constructor will no longer attempt to create a unique SHM key for the user. If a key is not specified in the shm configuration array, the default value will be used. A key provided in the constructor takes precedence over a value specified by INI.
- The layout of the shared memory used by the client when using an SHM key has changed. The default key has changed as well in order to prevent accidental sharing between new and old clients.
- The formatting of the response from an info call may have changed. It now includes the request at the beginning of the response.
- When using initKey with a digest, the digest must now be exactly 20 bytes.
- The integer values of the `Aerospike::LOG_LEVEL_*` constants have changed. This should not effect the user unless they were providing log levels as integers rather than using the constants.
- `Aerospike::LOG_LEVEL_OFF` has been removed. It no longer had any effect.

Documentation
-------------

[](#documentation)

Documentation of this legacy Aerospike PHP Client is in the [doc directory](doc/README.md). Notes on the internals of the implementation are in [doc/internals.md](doc/internals.md).

[Example PHP code](examples/) can be found in the `examples/` directory.

Dependencies
------------

[](#dependencies)

### CentOS and RedHat (yum)

[](#centos-and-redhat-yum)

```
sudo yum groupinstall "Development Tools"
sudo yum install openssl-devel
# You will need PHP7 development headers. If PHP7 was manually installed, these should be available
# by default; Otherwise, you will need to fetch them from a repository, the package name may vary.
sudo yum install php-pear # unless PHP was manually installed

```

### Ubuntu and Debian (apt)

[](#ubuntu-and-debian-apt)

```
sudo apt-get install build-essential autoconf libssl-dev
sudo apt-get install php7.0-dev php-pear # unless PHP was manually installed

```

### OS X

[](#os-x)

By default OS X will be missing command line tools. On Mavericks (OS X 10.9) and higher those [can be installed without Xcode](http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/).

```
xcode-select --install # install the command line tools, if missing

```

The dependencies can be installed through the OS X package manager [Homebrew](http://brew.sh/).

```
brew update && brew doctor
brew install automake
brew install openssl

```

To switch PHP versions [see this gist](https://gist.github.com/rbotzer/198a04f2315e88c75322).

Do to the dependence of this Library upon OpenSSL, there will ocassionally be linking issues which will show up during installation. To Solve these we recommend running brew info openssl

This command will show some information about where the openssl headers and library are located. In particular there should a stanza which looks something like: For compilers to find this software you may need to set: LDFLAGS: -L/usr/local/opt/openssl/lib CPPFLAGS: -I/usr/local/opt/openssl/include

in order to properly link and compile against the library you can set the two environment variables `AS_OSX_OPENSSL_INC` and `AS_OSX_OPENSSL_LINK` to the respective values (if the paths were as specified above): export AS\_OSX\_OPENSSL\_INC="-I/usr/local/opt/openssl/include" export AS\_OSX\_OPENSSL\_LINK="-L/usr/local/opt/openssl/lib"

Windows is currently not supported.

Installation
------------

[](#installation)

### Building with Composer

[](#building-with-composer)

Using [Composer](https://getcomposer.org/) you can download and build the PHP extension:

```
composer require aerospike/aerospike-client-php ~7.0
find vendor/aerospike/aerospike-client-php/ -name "*.sh" -exec chmod +x {} \;
cd vendor/aerospike/aerospike-client-php/ && sudo composer run-script post-install-cmd

```

### Building Manually

[](#building-manually)

To build the PHP extension manually you will need to fetch the [latest release](https://github.com/aerospike/aerospike-client-php/releases/latest)from Github, then run the `build.sh` script in the `src/` directory.

```
cd src
./build.sh

```

This will download the Aerospike C client SDK if necessary into `src/../aerospike-client-c/`, and initiate `make`.

Installing the PHP Extension
----------------------------

[](#installing-the-php-extension)

To install the PHP extension do:

```
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_user_path=/path/to/aerospike/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/php7/apache2/conf.d/`, `/etc/php7/fpm/conf.d/`or wherever the configuration include directory of the web server is, then issue a graceful restart.

License
-------

[](#license)

The Aerospike PHP Client is made availabled under the terms of the Apache License, Version 2, as stated in the file [LICENSE](./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.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance8

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community33

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 61.3% 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

Every ~70 days

Recently: every ~120 days

Total

14

Last Release

2260d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/133497?v=4)[Ronen Botzer](/maintainers/rbotzer)[@rbotzer](https://github.com/rbotzer)

![](https://www.gravatar.com/avatar/13090f64c62ba4e0b7f18bfc75760f875107558573f4b05709f747671e55adff?d=identicon)[aerospike-php-build](/maintainers/aerospike-php-build)

![](https://www.gravatar.com/avatar/3161b1bd51833e978fa7efd4eb229dc7a36c8bf2aeb183bb4f86fba39786ab35?d=identicon)[smurthy@aerospike.com](/maintainers/smurthy@aerospike.com)

---

Top Contributors

[![aerospikerobertmarks](https://avatars.githubusercontent.com/u/25595592?v=4)](https://github.com/aerospikerobertmarks "aerospikerobertmarks (84 commits)")[![dwelch-spike](https://avatars.githubusercontent.com/u/53876192?v=4)](https://github.com/dwelch-spike "dwelch-spike (31 commits)")[![rbotzer](https://avatars.githubusercontent.com/u/133497?v=4)](https://github.com/rbotzer "rbotzer (10 commits)")[![sustmi](https://avatars.githubusercontent.com/u/885946?v=4)](https://github.com/sustmi "sustmi (3 commits)")[![ramunasd](https://avatars.githubusercontent.com/u/150403?v=4)](https://github.com/ramunasd "ramunasd (2 commits)")[![MortalFlesh](https://avatars.githubusercontent.com/u/6317184?v=4)](https://github.com/MortalFlesh "MortalFlesh (2 commits)")[![zekena](https://avatars.githubusercontent.com/u/47516518?v=4)](https://github.com/zekena "zekena (1 commits)")[![arrowplum](https://avatars.githubusercontent.com/u/417616?v=4)](https://github.com/arrowplum "arrowplum (1 commits)")[![compositephp](https://avatars.githubusercontent.com/u/38870693?v=4)](https://github.com/compositephp "compositephp (1 commits)")[![vityank](https://avatars.githubusercontent.com/u/18400127?v=4)](https://github.com/vityank "vityank (1 commits)")[![adam-lutka](https://avatars.githubusercontent.com/u/17009072?v=4)](https://github.com/adam-lutka "adam-lutka (1 commits)")

---

Tags

databaseextensionaerospike

### Embed Badge

![Health badge](/badges/aerospike-aerospike-client-php/health.svg)

```
[![Health](https://phpackages.com/badges/aerospike-aerospike-client-php/health.svg)](https://phpackages.com/packages/aerospike-aerospike-client-php)
```

###  Alternatives

[johnitvn/yii2-ajaxcrud

Gii CRUD template for Single Page Ajax Administration for yii2

97209.6k16](/packages/johnitvn-yii2-ajaxcrud)[dmstr/yii2-db

Database extensions

19618.8k6](/packages/dmstr-yii2-db)[hzhihua/yii2-dump

Generate the schema from an existing database

1828.5k1](/packages/hzhihua-yii2-dump)

PHPackages © 2026

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