PECL安装Cassandra投掷:“错误:无法在OS X上加载libcassandra”



我已经安装了所有的cassandra和php pecl/pear depentencies和cassandra 3都可以在我的 mac> mac 上使用,并且CQLSH正在工作健康,但在运行pecl install cassandra之后,抛出了此处:

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

安装驱动程序有时有些复杂。但是我认为一件事对您来说真的很重要: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/master/ext/ext/readme.md安装后,您必须将模块添加到php.ini

我找到了解决方案问题是由于OS X 10.11 El Capitan的无根特征。要能够将扩展名安装到/usr/lib/php/*我必须暂时禁用该功能(说明 - 请记住之后重新启用它)。

这样做之后,我需要通过以下命令重新编译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

最新更新