git clone https://github.com/datastax/php-driver.git /usr/src/datastax-php-driver
cd /usr/src/datastax-php-driver
git submodule update --init
cd ext
./install.sh
vim /etc/php/7.1/mods-available/cassandra.ini
extension=cassandra.so
phpenmod cassandra
php -i | grep cassandra
/etc/php/7.1/cli/conf.d/20-cassandra.ini,
cassandra
cassandra.log => cassandra.log => cassandra.log
cassandra.log_level => ERROR => ERROR
Well, that's ok, but
When, I have tried running test connect(php) to cassandra, I had error.
php cass.php
PHP Fatal error: Uncaught Cassandra\Exception\LogicException: Not implemented in /root/cass.php:3
Stack trace:
#0 /root/cass.php(3): Cassandra\Cluster\Builder->build()
#1 {main}
thrown in /root/cass.php on line 3
cat cass.php
<?php
$cluster = Cassandra::cluster() // connects to localhost by default
->build();
$keyspace = 'system';
$session = $cluster->connect($keyspace); // create session, optionally scoped to a keyspace
$statement = new Cassandra\SimpleStatement( // also supports prepared and batch statements
'SELECT keyspace_name, columnfamily_name FROM schema_columnfamilies'
);
$future = $session->executeAsync($statement); // fully asynchronous and easy parallel execution
$result = $future->get(); // wait for the result, with an optional timeout
foreach ($result as $row) { // results and rows implement Iterator, Countable and ArrayAccess
printf("The keyspace %s has a table called %s\n", $row['keyspace_name'], $row['columnfamily_name']);
}
?>
Please help me! Thanks.
--
You received this message because you are subscribed to the Google Groups "DataStax PHP Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-driver-user+unsubscribe@lists.datastax.com.
There is likely an older version (< 2.1.0) of the cpp-driver shared library in "/usr/local/lib" or "/usr/lib" that's being favored over a newer version of the driver in "/usr/lib/x86_64-linux-gnu/"?Only supporting protocol v1/v2 and not having "cass_cluster_set_use_schema()` sounds like an older version of the cpp-driver is being used at runtime.
Let me know if this helps.
Mike