【发布时间】:2014-11-14 14:16:35
【问题描述】:
如何在 CentOS 6.5 中为 Apache PHP 安装扩展 pdo_cassandra。我需要 PHP 可以与 Cassandra DB 一起使用。
【问题讨论】:
如何在 CentOS 6.5 中为 Apache PHP 安装扩展 pdo_cassandra。我需要 PHP 可以与 Cassandra DB 一起使用。
【问题讨论】:
我刚刚获得了一个在 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
【讨论】: