CentOS 6.7上用于PHP的Datastax Cassandra驱动程序的问题:未定义的符号:cass_cluster_set_whitelist_dc_filtering在第0行的未知

时间:2016-05-19 09:37:36

标签: php cassandra datastax-enterprise datastax-startup datastax-php-driver

我已使用以下过程为PHP安装了datastax cassandra驱动程序扩展:

  • 已安装的依赖项: automake cmake gcc gcc-c ++ git libtool openssl-devel wget gmp gmp-devel boost php-devel pcre-devel git libuv gmp
  • 通过源代码编译安装cpp-driver
  • 从源
  • 安装了PHP Datastax cassandra驱动程序
  • 在/etc/php.ini文件中添加了扩展程序

当我尝试执行php文件以连接到cassandra集群时,我收到以下错误

 PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/cassandra.so' 
- /usr/lib64/php/modules/cassandra.so: undefined symbol: cass_cluster_set_whitelist_dc_filtering in Unknown on line 0

我尝试使用二进制文件再次安装,我仍然面临同样的问题。

这是ldd输出:

ldd /usr/lib64/php/modules/cassandra.so
    linux-vdso.so.1 =>  (0x00007ffe9ad9a000)
    libgmp.so.3 => /usr/lib64/libgmp.so.3 (0x00007f2377ca2000)
    libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007f2377a35000)
    libz.so.1 => /lib64/libz.so.1 (0x00007f237781f000)
    libuv.so.1 => /usr/lib64/libuv.so.1 (0x00007f23775fe000)
    librt.so.1 => /lib64/librt.so.1 (0x00007f23773f5000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f23771d8000)
    libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f2376fbf000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f2376dba000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f2376b36000)
    libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f2376830000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f2376619000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f2376285000)
    libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f2376041000)
    libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f2375d59000)
    libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f2375b55000)
    libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f2375929000)
    libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00007f2375544000)
    /lib64/ld-linux-x86-64.so.2 (0x00000030d4a00000)
    libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f2375339000)
    libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f2375135000)
    libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f2374f1b000)
    libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f2374cfb000)

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

看起来您可能正在使用错误版本的cpp-driver进行php-driver扩展。目前在php-driver master上,cpp-driver子模块指向v2.2.2,而黑名单,白名单DC和黑名单DC负载均衡策略已添加到v2.3.0

建议构建并安装最新版本的cpp-driver,然后再次为您正在使用的php驱动程序源执行构建和安装步骤。