Reputation: 105
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?
Upvotes: 1
Views: 863
Reputation: 169
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
Upvotes: 0
Reputation: 178
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
Upvotes: 3