解壓縮至Apache的網頁路徑即可使用
http://cassandra-php-client-library.com/download
Git
下面是自己 Build 的
$ cd ~/thrift //移動到Thrift 路徑
$ sudo apt-get install libboost-dev automake libtool flex bison pkg-config g++
$ ./configure
之後他會對系統安裝的程式做確認
checking for a Python interpreter with version >= 2.4... python
checking for python... /usr/bin/python
checking for python version... 2.7
....etc
如果沒有請依照顯示的錯誤訊息去找需要的安裝
如果想要省略C++可以使用如下方法
$ ./configure -with-cpp=no
$ make
$ ./compiler/cpp/thrift -gen php ~/cassandra/interface/cassandra.thrift
$ sudo mkdir -p /usr/share/php/Thrift
$ sudo cp -R gen-php/ /usr/share/php/Thrift/packages/
$ sudo cp -R lib/php/src/* /usr/share/php/Thrift/
$ cd ~/thrift/lib/php/src/ext/thrift_protocol
$ sudo apt-get install php5-dev
$ phpize
$ ./configure --enabke-thrift_protocol
$ make
如果編譯錯誤少了config.m4
複製下面文字並新增config.m4檔案到 ~/thrift/lib/php/src/ext/thrift_protocol 目錄底下
dnl Copyright (C) 2009 Facebook
dnl Copying and distribution of this file, with or without modification,
dnl are permitted in any medium without royalty provided the copyright
dnl notice and this notice are preserved.
PHP_ARG_ENABLE(thrift_protocol, whether to enable the thrift_protocol extension,
[ --enable-thrift_protocol Enable the fbthrift_protocol extension])
if test "$PHP_THRIFT_PROTOCOL" != "no"; then
PHP_REQUIRE_CXX()
PHP_ADD_LIBRARY_WITH_PATH(stdc++, "", THRIFT_PROTOCOL_SHARED_LIBADD)
PHP_SUBST(THRIFT_PROTOCOL_SHARED_LIBADD)
PHP_NEW_EXTENSION(thrift_protocol, php_thrift_protocol.cpp, $ext_shared)
fi
Reference
沒有留言:
張貼留言