pecl install cassandra throws:OS X上的“错误:无法加载libcassandra”

时间:2016-06-24 12:11:47

标签: php cassandra datastax pecl datastax-php-driver

我已经安装了所有的cassandra和php pecl / pear依赖项,我的 mac 上提供了cassandra 3,cqlsh运行正常但运行后{{1} ,抛出这个:

  

configure:错误:无法加载libcassandra       错误:`/ private / tmp / pear / install / cassandra / configure --with-php-config = / usr / bin / php-config'失败

2 个答案:

答案 0 :(得分:0)

安装驱动程序有时候有点复杂。但我认为有一点对你来说非常重要:php驱动程序与cassandra 3不兼容。

Apache Cassandra versions 1.2, 2.0 and 2.1
DataStax Enterprise 3.1, 3.2, 4.0 and 4.5
PHP 5.5+ and PHP 7.0+
Compilers: GCC 4.1.2+, Clang 3.4+, and MSVC 2010/2012/2013/2015

pecl安装也从未在我的机器上运行。我自己制作驱动程序:https://github.com/datastax/php-driver/blob/master/ext/README.md 安装后,您必须将模块添加到php.ini

答案 1 :(得分:0)

我找到了解决方案 问题是由OS X 10.11 El Capitan的Rootless功能引起的。为了能够将扩展安装到/ usr / lib / php / *,我必须暂时禁用该功能({{3}} - 请记得以后重新启用它。)

执行此操作后,我需要使用以下命令重新编译cassandra驱动程序:

git clone https://github.com/datastax/php-driver.git
cd php-driver
git submodule update --init
cd ext
./install.sh
phpize
./configure
make install

所有依赖项我们必须在编译cassandra php驱动程序之前安装:

brew install gmp
brew install libuv
brew install cmake
sudo chown -R $USER /usr/local
brew link cmake
brew unlink openssl && brew link openssl --force
brew install autoconf

brew install icu4c
pecl update-channels
brew link icu4c --force

pecl install intl
brew install pcre