########################################## git 설치
cassandra-pdo 소스를 다운받기 위해서는 git이 필요하며 다음 명령어로 git을 설치 합니다.
#yum install git
centos 6 은 yum 으로 가능하지만 centos 5는 소스를 다운로드하여 설치 하여야 합니다.
http://distfiles.macports.org/git-core/
#wget http://distfiles.macports.org/git-core/git-1.8.2.2.tar.gz
#tar zxvf git-1.8.2.2.tar.gz
#cd git-1.8.2.2
#./configure
#make && make install
cassandra-pdo 프로젝트 url
http://code.google.com/a/apache-extras.org/p/cassandra-pdo/
다음 명령어로 cassandra-pdo 소스를 다운 받습니다.
#git clone https://code.google.com/a/apache-extras.org/p/cassandra-pdo/
cassandra-pdo를 설치하기 위해서는 thrift 와 boost 라이브러리가 필요하며 공식 홈페이지는 다음과 같습니다.
http://thrift.apache.org/download/
http://www.boost.org/users/download/
########################################## thrift 설치
thrift 의 경우 0.9.0 버전까지 나왔으나 cassandra-pdo 설치 중 (centos 5.8 환경) 에러가 발생하여 0.7.0 버전을 사용 하였습니다.
#wget http://archive.apache.org/dist/thrift/0.7.0/thrift-0.7.0.tar.gz
#tar zxvf thrift-0.7.0.tar.gz
#cd thrift-0.7.0
#chmod +x configure
#./configure
#make
#make install
########################################## boost 라이브러리 설치
boost 라이브러리의 경우 yum으로 설치시 필요한 라이브러리가 충족되지 않아 소스를 다운받아 설치 합니다.
#tar zxvf boost_1_53_0.tar.gz
#mv boost_1_53_0 /usr/local/boost_1_53_0
#cd /usr/local/boost_1_53_0
#./bootstrap.sh
#./b2
#ln -s /usr/local/boost_1_53_0 /usr/local/boost_1_53_0/include
########################################## cassandra-pdo 설치
이제 cassandra-pdo를 설치하며 php는 5.3.8 버전에서 테스트 하였습니다.
#cd $down_path/cassandra-pdo
#$php_path/bin/phpize
#./configure --with-php-config=$php_path/bin/php-config --with-boost-dir=/usr/local/boost_1_53_0
#make
centos 5 또는 32bit 에서는 다음과 같은 에러가 발생할 수 있습니다. (centos6 64bit 에서는 미발생)
cassandra_statement.cpp:231: error: ‘tsrm_ls’ was not declared in this scope
make: *** [cassandra_statement.lo] 오류 1
에러 발생시 cassandra_statement.cpp 파일의 (2013/05/07 ver.) 231 라인에 다음과 같이 TSRMLS_FETCH(); 을 추가하여야 합니다.
========================================================================
static long pdo_cassandra_marshal_numeric(pdo_stmt_t *stmt, const std::string &binary)
{
if (sizeof(long) < binary.size()) {
TSRMLS_FETCH();
pdo_cassandra_error(stmt->dbh, PDO_CASSANDRA_INTEGER_CONVERSION_ERROR, "The value is too large for integer datatype", "");
return LONG_MAX;
}
const unsigned char *bytes = reinterpret_cast <const unsigned char *>(binary.c_str());
long val = 0;
size_t siz = binary.size ();
for (size_t i = 0; i < siz; i++)
val = val << 8 | bytes[i];
return val;
}
========================================================================
make 후 생성되는 modules/pdf_cassandra.so 파일을 php extension 디렉토리에 복사하여 php.ini에 등록한 후 아파치를 재가동 하면 됩니다.
php 모듈 추가 관련은 다음 url 참고
http://www.worldwalker.co.kr/entry/php-재설치-없이-확장모듈-추가하는-방법
Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다
Trackback RSS : http://www.worldwalker.co.kr/rss/trackback/134
Trackback ATOM : http://www.worldwalker.co.kr/atom/trackback/134
당신의 의견을 작성해 주세요.