问题
I am using cassandra with php. cassandra server and client. both have been started. It throws following error :
Fatal error: Call to a member function write() on a non-object in C:\cassandra\thrift\Thrift.php on line 715
Call Stack
# Time Memory Function Location
1 0.0010 395808 {main}( ) ..\cassandra_testFile.php:0
2 0.0409 3143872 CassandraClient->insert( ) ..\cassandra_testFile.php:46
3 0.0409 3143872 CassandraClient->send_insert( ) ..\Cassandra.php:606
4 0.0412 3146072 cassandra_Cassandra_insert_args->write( ) ..\Cassandra.php:625
5 0.0412 3146136 TBase->_write( ) ..\Cassandra.php:2761
In call stack, at step 2. Line no. 46 is :
$client->insert($keyspace, $keyUserId, $columnPath, $value, $timestamp, $consistency_level);
How can this error be resolved?
回答1:
Many, many, many people use a client in front of Thrift. For PHP, the most common is PHPCassa
- Which PHP client library to use with Cassandra?
- Cassandra via PHP
回答2:
Connection via Thrift deprecated.
PHP library for Cassandra database via a binary protocol.
来源:https://stackoverflow.com/questions/10164034/cassandra-not-working-with-php