Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pecl install cassandra throws: "error: Unable to load libcassandra"

pecl install cassandra

produces an error:

configure: error: Unable to load libcassandra

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

This error message is subject of another question here on SO, but has not been resolved: Installing php datastax driver on ubuntu

Can anybody help?

like image 507
Tobias Gassmann Avatar asked Oct 07 '15 16:10

Tobias Gassmann


2 Answers

You are missing cassandra C++ driver. I have run into the same issue on Ubuntu 14.04. I have done the following and it worked for me:

Prerequisites (Ubuntu 14.04):

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

Download the following packages:

wget http://downloads.datastax.com/cpp-driver/ubuntu/16.04/dependenices/libuv/v1.8.0/libuv_1.8.0-1_amd64.deb
wget http://downloads.datastax.com/cpp-driver/ubuntu/16.04/dependenices/libuv/v1.8.0/libuv-dev_1.8.0-1_amd64.deb
wget http://downloads.datastax.com/cpp-driver/ubuntu/16.04/v2.4.1/cassandra-cpp-driver_2.4.1-1_amd64.deb
wget http://downloads.datastax.com/cpp-driver/ubuntu/16.04/v2.4.1/cassandra-cpp-driver-dev_2.4.1-1_amd64.deb

Install them in this order using dpkg:

sudo dpkg -i libuv_1.8.0-1_amd64.deb
sudo dpkg -i libuv-dev_1.8.0-1_amd64.deb
sudo dpkg -i cassandra-cpp-driver-dev_2.4.1-1_amd64.deb
sudo dpkg -i cassandra-cpp-driver_2.4.1-1_amd64.deb

You should be able to install cassandra using pecl. Don't forget to add extension=cassandra.so to your php.ini file and restart php process.

Based on an answer in the discussion you linked before.

like image 104
rock-ass Avatar answered Sep 19 '22 14:09

rock-ass


This is how I got it to work (on debian):

sudo apt-get update
sudo apt-get install -y g++ git make cmake clang libssl-dev libgmp-dev php5-cgi php5-fpm php5 php5-dev openssl libpcre3-dev
sudo apt-get install libc6
sudo apt-get -f install
sudo curl http://downloads.datastax.com/cpp-driver/ubuntu/14.04/libuv_1.7.5-1_amd64.deb > /var/www/html/libuv_1.7.5-1_amd64.deb
sudo curl http://downloads.datastax.com/cpp-driver/ubuntu/14.04/libuv-dev_1.7.5-1_amd64.deb > /var/www/html/libuv-dev_1.7.5-1_amd64.deb
sudo curl http://downloads.datastax.com/cpp-driver/ubuntu/14.04/cassandra-cpp-driver_2.0.1-1_amd64.deb > cassandra-cpp-driver_2.0.1-1_amd64.deb
sudo curl http://downloads.datastax.com/cpp-driver/ubuntu/14.04/cassandra-cpp-driver-dev_2.0.1-1_amd64.deb > cassandra-cpp-driver-dev_2.0.1-1_amd64.deb
sudo dpkg -i libuv_1.7.5-1_amd64.deb
sudo dpkg -i libuv-dev_1.7.5-1_amd64.deb
sudo dpkg -i cassandra-cpp-driver_2.0.1-1_amd64.deb
sudo dpkg -i cassandra-cpp-driver-dev_2.0.1-1_amd64.deb
sudo pecl install cassandra
like image 30
Reinier Avatar answered Sep 19 '22 14:09

Reinier