pecl install cassandra 抛出:“错误:无法加载 libcassandra"

2021-12-31 00:00:00 php pecl cassandra datastax-php-driver
pecl install cassandra

产生错误:

配置:错误:无法加载 libcassandra

configure: error: Unable to load libcassandra

错误:`/tmp/pear/temp/cassandra/configure' 失败

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

此错误消息是 SO 上的另一个问题的主题,但尚未解决:在ubuntu上安装php datastax驱动

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

有人可以帮忙吗?

推荐答案

您缺少 cassandra C++ 驱动程序.我在 Ubuntu 14.04 上遇到了同样的问题.我做了以下工作,它对我有用:

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:

先决条件(Ubuntu 14.04):

Prerequisites (Ubuntu 14.04):

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

下载以下软件包:

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

使用 dpkg 按此顺序安装它们:

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

您应该能够使用 pecl 安装 cassandra.不要忘记将 extension=cassandra.so 添加到您的 php.ini 文件并重新启动 php 进程.

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.

相关文章