Datastax - Cassandra php-driver: Uncaught Cassandra\Exception\LogicException:

 ̄綄美尐妖づ 提交于 2019-12-11 07:28:28

问题


I'm on Ubuntu right now trying to connect to Cassandra with PHP. I have installed Datastax php-driver and all of its dependencies but i get this error when trying to run a testfile:

    PHP Fatal error:  Uncaught Cassandra\Exception\LogicException: Not    implemented in /home/philip/Documents/test.php:3
Stack trace:
#0 /home/user/Documents/test.php(3): Cassandra\Cluster\Builder->build()
#1 {main}
  thrown in /home/user/Documents/test.php on line 3

The code looks like this:

 <?php
// Connect to the cluster and keyspace "killrvideo"
$cluster  = Cassandra::cluster()->build();
$keyspace  = 'killrvideo';
$session  = $cluster->connect($keyspace);

I manage to connect to cassandra using the shell cqlsh and i can see the table i have setup. The php code doesnt seem to work though. Any ideas why?


回答1:


We have the same issue. This works for me. Thanks a lot @AlexandruCircus!

git clone https://github.com/datastax/php-driver.git
git reset --hard f50c93da3ea73ad8fcf8b181d0313d437e559256
cd php-driver/ext
./install.sh



回答2:


well this is not very clear for me but you call this from the same server ? witch strategy you use ? simples or network topology ? but something that I'm sure will work with this

$cluster = Cassandra::cluster()->withContactPoints('127.0.0.1')->build();

// or if you call from a different server just replace the ip



来源:https://stackoverflow.com/questions/42065573/datastax-cassandra-php-driver-uncaught-cassandra-exception-logicexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!