Alice
Alice

Reputation: 144

How install extension pdo_cassandra in CentsOS 6.5 for Apache PHP?

How install extension pdo_cassandra in CentOS 6.5 for Apache PHP. I need that PHP might work with a Cassandra DB.

Upvotes: 0

Views: 381

Answers (1)

Matt Indeedhat Holmes
Matt Indeedhat Holmes

Reputation: 725

I just got a PHP driver working for Cassandra on CentOS 7.

instead of the pdo_cassandra extension I used the Datastax Cassandra extension, here is what I did to get it working:

Install Apache Thrift

> git clone https://github.com/apache/thrift.git
> cd thrift
> ./bootstrap.sh
> ./configure --with-lua=no 
> make 
> make install

Install C++ Driver (Cassandra)

> rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
> sudo yum install automake cmake gcc-c++ git libtool openssl-devel wget
> wget http://dist.libuv.org/dist/v1.4.2/libuv-v1.4.2.tar.gz
> tar xzf libuv-v1.4.2.tar.gz
> cd libuv-v1.4.2.tar.gz
> sh autogen.sh
> ./configure
> make install
> wget https://github.com/datastax/cpp-driver/archive/2.0.zip
> unzip 2.0.zip
> cd cpp-driver-2.0
> mkdir build
> cd build
> cmake ..
> make 
> make install
> ln -s /usr/local/lib64/libcassandra.so.2 /usr/lib64/libcassandra.so.2

Install PHP Driver (Cassandra)

> yum -y install gmp-devel
> git clone https://github.com/datastax/php-driver.git
> cd php-driver/ext
> pecl install package.xml
> echo extension=cassandra.so > /etc/php.d/cassandra.ini
> systemctl restart httpd

Upvotes: 1

Related Questions