Installing php datastax driver on ubuntu
Asked Answered
R

2

6

I am trying to install the datastax php driver for Cassandra and when i run the following command:

pecl install ext/package.xml

after checking it out of git i get the following message:

configure: error: Unable to load libcassandra

ERROR: `/tmp/pear/temp/cassandra/configure' failed

Can anyone point me in the right direction in order to successfully install this driver please?

version of cassandra i am using is 2.1.8 so maybe the driver has not been updated to connect to the latest version of cassandra.

Ravioli answered 5/8, 2015 at 17:14 Comment(10)
What does your config.log file say? Should be located in the directory where it is building in.Denishadenison
cc: error: unrecognized command line option '-qversion'. not quite sure what im looking for config.logRavioli
any help would be much appreciatedRavioli
what shell are you using? have you tried bash?Indeed
i havent tried bash as i thought the standard terminal is required.Ravioli
When i start the cqlsh i get a native protocol once ive connected should that be thrift protocol?Ravioli
i got this today as wellSignorino
basically i need to have the c++ driver installed before i run the pecl command. im pretty convinced that thrift is the way forward but this is used as a workaround.Ravioli
it seems the installation of the cpp-driver did not do the trickRavioli
medium.com/@Renjthvr/…Steger
R
-2

This has been resolved there was an issue with the incorrect php.ini not being referenced in phpinfo().

Ravioli answered 20/8, 2015 at 11:2 Comment(0)
D
6

The following steps worked for me. YMMV.

$ uname -a
3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u3 x86_64 GNU/Linux

Install some prereqs (removed libuv-dev from the list):

$ sudo apt-get install g++ make cmake libssl-dev libgmp-dev php5 php5-dev openssl libpcre3-dev

Trying to install libuv-dev right now will result in the following error:

libuv depends on libc6 (>= 2.14); however: Version of libc6:amd64 on system is 2.13-38+deb7u8.

Wheezy seems to have a slightly older version of libc6. Step up to Jessie to get 2.14. Add the following to /etc/apt/sources.list:

deb ftp://ftp.debian.org/debian/ jessie main
deb-src ftp://ftp.debian.org/debian/ jessie main

After running the following commands, these services will be restarted: mysql, exim4, cups, cron, atd, apache2

$ sudo apt-get update
$ sudo apt-get install libc6
$ sudo apt-get -f install

Download and install the following files:

$ wget http://downloads.datastax.com/cpp-driver/ubuntu/14.04/libuv_1.6.1-1_amd64.deb
$ wget http://downloads.datastax.com/cpp-driver/ubuntu/14.04/libuv-dev_1.6.1-1_amd64.deb
$ wget http://downloads.datastax.com/cpp-driver/ubuntu/14.04/cassandra-cpp-driver_2.1.0-1_amd64.deb
$ wget http://downloads.datastax.com/cpp-driver/ubuntu/14.04/cassandra-cpp-driver-dev_2.1.0-1_amd64.deb
$ sudo dpkg -i libuv_1.6.1-1_amd64.deb
$ sudo dpkg -i libuv-dev_1.6.1-1_amd64.deb
$ sudo dpkg -i cassandra-cpp-driver_2.1.0-1_amd64.deb
$ sudo dpkg -i cassandra-cpp-driver-dev_2.1.0-1_amd64.deb

Download and install the DataStax Cassandra PHP extension:

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

Add the extension to php.ini:

$ sudo sh -c 'echo "extension=cassandra.so" >>/etc/php5/apache2/php.ini'

Restart Apache:

$ sudo /etc/init.d/apache2 restart

Confirm Cassandra appears using <?php phpinfo();

Diffidence answered 14/8, 2015 at 22:1 Comment(0)
R
-2

This has been resolved there was an issue with the incorrect php.ini not being referenced in phpinfo().

Ravioli answered 20/8, 2015 at 11:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.