![](/img/trans.png)
[英]running Cassandra from php shell command (using datastax php-driver)
[英]Datastax - Cassandra php-driver: Uncaught Cassandra\Exception\LogicException:
我正在Ubuntu上嘗試用PHP連接到Cassandra。 我已經安裝了Datastax php-driver及其所有依賴項,但在嘗試運行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
代碼如下所示:
<?php
// Connect to the cluster and keyspace "killrvideo"
$cluster = Cassandra::cluster()->build();
$keyspace = 'killrvideo';
$session = $cluster->connect($keyspace);
我設法使用shell cqlsh連接到cassandra,我可以看到我已經設置的表。 PHP代碼似乎沒有工作。 有什么想法嗎?
我們有同樣的問題。 這適合我。 非常感謝@AlexandruCircus!
git clone https://github.com/datastax/php-driver.git git reset --hard f50c93da3ea73ad8fcf8b181d0313d437e559256 cd php-driver/ext ./install.sh
這對我來說不是很清楚,但是你從同一台服務器上調用它? 你使用的女巫策略? 簡單或網絡拓撲? 但我確信會對此有用
$ cluster = Cassandra :: cluster() - > withContactPoints('127.0.0.1') - > build();
//或者如果你從另一台服務器打電話,只需更換ip
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.