Keyspace1 is included by default in the cassandra.yaml file and I
imported the schema before running the php script
so I hope that is not the problem..

I am now too much frustrated with this problem..:(  and this is just
the beginning of my Cassandra experiments




On Mon, Dec 20, 2010 at 8:36 PM, Nick Bailey <n...@riptano.com> wrote:
> Have you created Keyspace1? Looks like phpcassa requires you to set a
> keyspace when you connect but the cli would not. Which might explain why you
> are seeing problems.
>
> On Mon, Dec 20, 2010 at 5:42 AM, Rajkumar Gupta <rajkumar....@gmail.com>
> wrote:
>>
>> I am using the following code to connect to Cassandra 0.7.0 using
>> PHPcassa (thobbs)
>>
>> <?php
>> require_once('Z:/wamp/bin/php/'.'phpcassa/connection.php');
>> require_once('Z:/wamp/bin/php/'.'phpcassa/columnfamily.php');
>>
>>    $servers[0]['host'] = 'localhost';
>>    $servers[0]['port'] = '9160';
>>    $conn = new Connection('Keyspace1', $servers);
>>
>> $column_family = new ColumnFamily($conn, 'Standard1');
>> ?>
>>
>> However I am able to connect to cassandra instance through
>> cassandra-cli at command prompt but not through this php script.
>>
>>
>>
>>
>>
>> On Mon, Dec 20, 2010 at 11:10 AM, Nick Bailey <n...@riptano.com> wrote:
>> > It would probably help if you posted the code you are trying to use from
>> > your php script. I don't know much about the php client but I now
>> > someone on
>> > this list does.
>> >
>> > On Sun, Dec 19, 2010 at 10:55 PM, Rajkumar Gupta
>> > <rajkumar....@gmail.com>
>> > wrote:
>> >>
>> >> I am able to connect to cassandra through cassandra-cli command at
>> >> command prompt but not through my php script. I also checked after
>> >> changing the rpc address to 0.0.0.0 in cassandra.yaml file but it
>> >> still does not work!
>> >>
>> >>
>> >> On Mon, Dec 20, 2010 at 1:47 AM, Aaron Morton <aa...@thelastpickle.com>
>> >> wrote:
>> >> > Forgot to say, 0.0.0.0 is not a good idea in production...
>> >> > http://wiki.apache.org/cassandra/FAQ#cant_listen_on_ip_any
>> >> >
>> >> >
>> >> > On 20/12/2010, at 9:12 AM, Aaron Morton <aa...@thelastpickle.com>
>> >> > wrote:
>> >> >
>> >> >> I've not used the PHP client, but you can test connectivity to your
>> >> >> cluster using the cassandra-cli command line client in the bin/
>> >> >> folder.
>> >> >>
>> >> >> Also check the ThriftAddress setting in your storage-config, this
>> >> >> address is the one that the server will be listening on. Set it to
>> >> >> 0.0.0.0
>> >> >> to listen on all.
>> >> >>
>> >> >> Aaron
>> >> >>
>> >> >> On 19/12/2010, at 8:45 AM, Rajkumar Gupta <rajkumar....@gmail.com>
>> >> >> wrote:
>> >> >>
>> >> >>> 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.tont...@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...
>> >> >>> --
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> ___________________________________
>> >>
>> >> Rajkumar Gupta
>> >> Dihing 173,
>> >> Indian Institute of Technology Guwahati
>> >> India
>> >>
>> >>
>> >> http://in.linkedin.com/in/rajkumargupta1
>> >
>> >
>
>

Reply via email to