incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajkumar Gupta <rajkumar....@gmail.com>
Subject Problem in using PHPcassa: Uncaught exception 'Exception' with message 'Could not connect to a cassandra server'
Date Sat, 18 Dec 2010 19:45:06 GMT
Hi, I am trying to use phpcassa(Hoan's) with Cassandra 0.6.8 but when
I try to run the following php script that includes phpcassa,


<?php
       $GLOBALS['THRIFT_ROOT'] = 'Z:/wamp/bin/php/include/thrift/';
require_once $GLOBALS['THRIFT_ROOT'].'/packages/cassandra/Cassandra.php';
require_once $GLOBALS['THRIFT_ROOT'].'/transport/TSocket.php';
require_once $GLOBALS['THRIFT_ROOT'].'/protocol/TBinaryProtocol.php';
require_once $GLOBALS['THRIFT_ROOT'].'/transport/TFramedTransport.php';
require_once $GLOBALS['THRIFT_ROOT'].'/transport/TBufferedTransport.php';

include_once('Z:/wamp/bin/php/include/phpcassa.php');
include_once('Z:/wamp/bin/php/include/uuid.php');

CassandraConn::add_node('192.168.1.1', 9160);

$users = new CassandraCF('Keyspace1', 'Users');

$users->insert('1', array('email' => 'hoan.tonthat@gmail.com',
'password' => 'test'));
?>


on running above script I get this error:

Fatal error: Uncaught exception 'Exception' with message 'Could not
connect to a cassandra server' in
Z:\wamp\bin\php\include\phpcassa.php:70 Stack trace: #0
Z:\wamp\bin\php\include\phpcassa.php(193): CassandraConn::get_client()
#1 Z:\wamp\www\PhpProject\index.php(38): CassandraCF->insert('1',
Array) #2 {main} thrown in Z:\wamp\bin\php\include\phpcassa.php on
line 70

Please let me know how can I make it work

Thanks...
--

Mime
View raw message