【问题标题】:How install extension pdo_cassandra in CentsOS 6.5 for Apache PHP?如何在 CentOS 6.5 中为 Apache PHP 安装扩展 pdo cassandra?
【发布时间】:2014-11-14 14:16:35
【问题描述】:

如何在 CentOS 6.5 中为 Apache PHP 安装扩展 pdo_cassandra。我需要 PHP 可以与 Cassandra DB 一起使用。

【问题讨论】:

    标签: php apache cassandra


    【解决方案1】:

    我刚刚获得了一个在 CentOS 7 上为 Cassandra 工作的 PHP 驱动程序。

    我使用 Datastax Cassandra 扩展而不是 pdo_cassandra 扩展,这是我为使其正常工作所做的:

    安装 Apache Thrift

    > git clone https://github.com/apache/thrift.git
    > cd thrift
    > ./bootstrap.sh
    > ./configure --with-lua=no 
    > make 
    > make install
    

    安装 C++ 驱动程序 (Cassandra)

    > rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
    > sudo yum install automake cmake gcc-c++ git libtool openssl-devel wget
    > wget http://dist.libuv.org/dist/v1.4.2/libuv-v1.4.2.tar.gz
    > tar xzf libuv-v1.4.2.tar.gz
    > cd libuv-v1.4.2.tar.gz
    > sh autogen.sh
    > ./configure
    > make install
    > wget https://github.com/datastax/cpp-driver/archive/2.0.zip
    > unzip 2.0.zip
    > cd cpp-driver-2.0
    > mkdir build
    > cd build
    > cmake ..
    > make 
    > make install
    > ln -s /usr/local/lib64/libcassandra.so.2 /usr/lib64/libcassandra.so.2
    

    安装 PHP 驱动程序 (Cassandra)

    > yum -y install gmp-devel
    > git clone https://github.com/datastax/php-driver.git
    > cd php-driver/ext
    > pecl install package.xml
    > echo extension=cassandra.so > /etc/php.d/cassandra.ini
    > systemctl restart httpd
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-03-23
      • 1970-01-01
      • 2019-02-14
      • 2013-01-18
      • 1970-01-01
      • 2016-04-24
      • 2014-11-13
      • 1970-01-01
      相关资源
      最近更新 更多