繁体   English   中英

pecl install cassandra在OS X上引发:“错误:无法加载libcassandra”

[英]pecl install cassandra throws: “error: Unable to load libcassandra” on OS X

我已经安装了所有的cassandra和php pecl / pear依赖项,并且cassandra 3在我的Mac上可用,并且cqlsh运行正常,但是在运行pecl install cassandra ,抛出此错误:

配置:错误:无法加载libcassandra错误:`/ private / tmp / pear / install / cassandra / configure --with-php-config = / usr / 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/ext/README.md安装后,您必须将模块添加到php.ini中

我找到了解决方案问题是由于OS X 10.11 El Capitan的Rootless功能所致。 为了能够将该扩展安装到/ 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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM