How to install Cassandra php driver

Apache Cassandra is a free and open-source distributed database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure. Cassandra offers robust support for clusters spanning multiple datacenters, with asynchronous masterless replication allowing low latency operations for all clients.

We need to install the additoinal driver for using cassandra with php.

This article explains the detailed steps to install php driver for cassandra.

The Cassandra PHP Extension depends on the following libraries:

The C/C++ driver and its dependencies.
The GNU Multiple Precision Arithmetic Library.
Libuv

Step1: Install the dependencies.

#yum install automake cmake gcc gcc-c++ libtool openssl-devel wget gmp gmp-devel boost php-devel pcre-devel
#pushd /tmp
#wget http://dist.libuv.org/dist/v1.4.2/libuv-v1.4.2.tar.gz
#tar xzf libuv-v1.4.2.tar.gz
#pushd libuv-v1.4.2
#sh autogen.sh
#./configure
#sudo make install
#popd
#popd

Step2: Install php driver.

#pecl install cassandra

You can also use PECL to install the driver from source by specifying the provided package.xml file path as the argument to pecl install command.

#git clone https://github.com/datastax/php-driver.git
#cd php-driver
#pecl install ext/package.xml

That's all...

Leave a Reply

Your email address will not be published. Required fields are marked *