Install php datastax driver on ubuntu

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

pecl install ext/package.xml 

after checking it from git, I get the following message:

 configure: error: Unable to load libcassandra ERROR: `/tmp/pear/temp/cassandra/configure' failed 

Can someone point me in the right direction to successfully install this driver, please?

The version of cassandra that I am using is 2.1.8, so the driver may not have been updated to connect to the latest version of cassandra.

+6
source share
2 answers

This was resolved, there was a problem with the wrong php.ini, which is not referenced in phpinfo ().

-2
source

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 prerequisites (removed libuv-dev from the list):

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

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

libuv depends on libc6 (> = 2.14); However: The libc6: amd64 version on the system is 2.13-38 + deb7u8.

Wheezy has a slightly older version of libc6 . Go up to Jesse 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 php.ini extension:

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

Restart Apache:

 $ sudo /etc/init.d/apache2 restart 

Confirm that Cassandra appears with <?php phpinfo();

+5
source

All Articles